Subscribe: RSS
  • Okay, I have a form which has 2 tabs.

    Tab 1) lists countries, each country is a hyperlink.
    Tab 2) lists resorts

    I have the tabs working fine, and all the processing works fine.

    This is what I’d like:

    By clicking on a hyperlink on Tab 1) it will go open Tab 2).

    I can pass the details of the country in the GET parameters, but I cannot seem to get the tab to select.

    When the page is loaded, WebFXTabPane gets the last tab opened (I have no say in this) and the tab is pre-selected from the cookie, or whatever it uses.

    How do I force WebFXTabPane to pick a tab based upon what I click a hyperlink click?
    • I’ve abandoned this idea now, because I don’t have enough time to work on it. Although it might prove useful if someone has a solution to this.
      • Here’s the solution, make it somewhere on your page..

        <script type="text/javaScript">
        j(function(){
        myURL = parseURL(window.location); //my code for getting the parameter
        tab = myURL.params[’tab’];
        if (!(tab === undefined)){
        tpSettings.setSelectedIndex( tab );
        console.log(’switched tab: ’ + tab);
        }

        });
        </script>


        You’ll notice, in the page code for a document, this block:

        <div class="tab-pane" id="documentPane">
        <script type="text/javascript">
        tpSettings = new WebFXTabPane( document.getElementById( "documentPane" ), false );
        </script>

        <!-- General -->
        <div class="tab-page" id="tabGeneral">

        <h2 class="tab">General</h2>
        <script type="text/javascript">tpSettings.addTabPage( document.getElementById( "tabGeneral" ) );</script>

        etc..