Facility Control

 View Only
  • 1.  Activate a script with onchange when seleccting a tab

    Posted 06-07-2022 11:18
    Hi, 
    I have a tab container with 5 five tabs.
    I am trying to set a variable when seleccting the differents tabs.
    I think I should use the onchange attribute, but I am not declaring properly.
    Anyone has an example?
    Best regards,
    Eduardo

    ------------------------------
    Eduardo Mayone
    ------------------------------


  • 2.  RE: Activate a script with onchange when seleccting a tab

    Posted 04-30-2023 21:26

    I was trying to figure this out, too, and finally got something working.  Adding an ogscript element to the meta section with the attribute handles="onchange" is half the puzzle.  You also need to added the targetid attribute with the id of the tab you want to follow.

    <meta>
    <ogscript handles="onchange" targetid="tab-id">
    //ogScript code
    </ogscript>
    </meta>
    <tab id="tab-id">
    </tab>

    Also, some other useful items from the manual:

    • Current tab index is: this.getSelectedIndex()
    • Current tab name is: this.getTitleAt(this.getSelectedIndex() )