Loading ...
Sorry, an error occurred while loading the content.

Problems with Tab Event beforeActiveTabChange

Expand Messages
  • Sean Callan
    Hey Guys, Version: 2.2.2 Browsers: Internet Explorer 7, Firefox 2.0.0.7 Code in question: myTabs.addListener( beforeActiveTabChange , validateBeforeContinue);
    Message 1 of 1 , Sep 28, 2007
    • 0 Attachment
      Hey Guys,

      Version: 2.2.2
      Browsers: Internet Explorer 7, Firefox 2.0.0.7

      Code in question:

      myTabs.addListener('beforeActiveTabChange', validateBeforeContinue);

      var validateBeforeContinue= function(e){
      var index = myTabs.getTabIndex(e.newValue);
      if(index > 0){
      var frm = document.forms[0];
      if (!frm.onsubmit || (frm.onsubmit && frm.onsubmit())){
      return true;
      }else{
      return false;
      }
      }
      }

      I'm having an issue with my tabs at the moment not adhering to how the
      API details they will. "If handler returns false, the change will be
      cancelled, [...]", this however is not the case. When I return false
      the tab still changes index and moves to the next tab. I'm currently
      trying to prevent the user from proceeding to new tabs until
      validation (which occurs in frm.onsubmit and frm.onsubmit()) is
      correct.

      Before the `return false` I added `myTabs.set('activeIndex', 0);`
      which would cause a flash to occur. The brower would switch tabs and
      jump back to index 0. This however isn't functioning properly in
      Firefox so I have done away with it in the hopes of finding the
      correct solution.

      Cheers,
      Sean
    Your message has been successfully submitted and would be delivered to recipients shortly.