setTab()

The setTab() function (client-side) changes the active tab to the specified tab.

Syntax

This is the general syntax for the setTab() function:

            setTab(tabCode, force); 

          

See more detailed information about the syntax formats available for this function:

  • To pass only the tab code as a parameter:

                    setTab('TAB_CODE'); 
    
                  
  • To pass all parameters:

                    setTab('TAB_CODE', true | false); 
    
                  

Return Value

The setTab() function returns undefined.

Parameters

Note:

The tab code is required.

The setTab() function accepts the following parameters:

  • TAB_CODE - A string representing the code of the tab to activate. You can find the code in the Code field on the table record.

  • force - If set to true and the tab is already active, this parameter refreshes the current active tab and activates all building blocks that include the predefined answer SOLE/SELECTED_TAB[="CURRENT_TAB_CODE"] in their rule. This parameter is false by default.

Examples

The following examples show how to use the setTab() function.

Changing the Active Tab

This example switches the currently displayed tab to the one identified with the code SHIPPING_DETAILS.

              setTab('SHIPPING_DETAILS'); 

            

If the tab is already active, you can force a refresh:

              setTab('SHIPPING_DETAILS', true); 

            

Related Topics

General Notices