In firefox ,on return false wrong tab is getting activated?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Soniad
    New Member
    • Jan 2009
    • 66

    In firefox ,on return false wrong tab is getting activated?

    Hi,

    I have ASP page where there are three tabs,each showing different content.
    Each tab have cancel button and save button.
    If validation is proper; then,
    Save button submits the page.Otherwise, returns false.
    Now,After validation , the tab which is actually activated willl be as it is after returning false.
    This is working fine in IE.
    But in FireFox,
    If first time,the tab which is activated (First/Second Or Third), and I switch to any other tab and there after filling the info ,and clicking on save button,if validation is false then it returns false but it automatically switches to the tab which was first time activated.it should not happened.

    Any Suggestion.

    Here is the JavaScript Code for "Onclick event" of "Save" button :

    Code:
    <script type="text/javascript">
    
    function FnSave(val)
    {
     var StrFolName,StrSubFolName,StrType,StrConfirm;
     
      /*CHECK WHETHER FOLDER NAME IS ENTERED*/ 
    
    	  StrFolName = Form.txtFolName.value;
    	  StrSubFolName = Form.txtSubFolName.value;
    
    
    	 if(val=="PARE")
    	 {
    		 if (StrFolName == "")
    		 {
    		   alert("Please enter new folder name...");
    		   return false;  
    		 }
    		 if(FnValidFlName(StrFolName)==false)
    		 {
    		  return false; 
    		 }
    		 
    		 StrConfirm = "Add Folder '"+StrFolName+"'?" 		 
     
    	 }
    	 
    	 if(val=="SUB")
    	 {
    		 if (StrSubFolName == "")
    		 {
    		   alert("Please enter Subfolder name...");
    		   return false;  
    		 }
    		 if(FnValidFlName(StrSubFolName)==false)
    		 {
    		  return false; 
    		 }		 
    		 if(StrSubFolName!="" & Form.CmbPareFolder.value=="")
    		 {
    		   alert("Please select parent folder for new Sub folder...");
    		   return false;  		 
    		 }
    		 
    		 StrConfirm = "Add Folder '"+StrSubFolName+"'?" 		 
    	 }
     
     /*SUBMIT TO SAVE*/
     if (confirm(StrConfirm))
     {
    		//CODE 
     }
     
    }
    
    </script>

    Regards,
    "D"
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Can I see your tab code or perhaps a test page?

    Comment

    • Soniad
      New Member
      • Jan 2009
      • 66

      #3
      Hi acoder,

      I tested that page again carefully.And noticed that, the page was getting submitted.
      Hence, when i wrote "return" before calling function in onclick event,it worked.

      Regards,
      "D"

      Comment

      Working...