473,396 Members | 1,894 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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

Soniad
66
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 :

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2.  
  3. function FnSave(val)
  4. {
  5.  var StrFolName,StrSubFolName,StrType,StrConfirm;
  6.  
  7.   /*CHECK WHETHER FOLDER NAME IS ENTERED*/ 
  8.  
  9.       StrFolName = Form.txtFolName.value;
  10.       StrSubFolName = Form.txtSubFolName.value;
  11.  
  12.  
  13.      if(val=="PARE")
  14.      {
  15.          if (StrFolName == "")
  16.          {
  17.            alert("Please enter new folder name...");
  18.            return false;  
  19.          }
  20.          if(FnValidFlName(StrFolName)==false)
  21.          {
  22.           return false; 
  23.          }
  24.  
  25.          StrConfirm = "Add Folder '"+StrFolName+"'?"          
  26.  
  27.      }
  28.  
  29.      if(val=="SUB")
  30.      {
  31.          if (StrSubFolName == "")
  32.          {
  33.            alert("Please enter Subfolder name...");
  34.            return false;  
  35.          }
  36.          if(FnValidFlName(StrSubFolName)==false)
  37.          {
  38.           return false; 
  39.          }         
  40.          if(StrSubFolName!="" & Form.CmbPareFolder.value=="")
  41.          {
  42.            alert("Please select parent folder for new Sub folder...");
  43.            return false;           
  44.          }
  45.  
  46.          StrConfirm = "Add Folder '"+StrSubFolName+"'?"          
  47.      }
  48.  
  49.  /*SUBMIT TO SAVE*/
  50.  if (confirm(StrConfirm))
  51.  {
  52.         //CODE 
  53.  }
  54.  
  55. }
  56.  
  57. </script>
  58.  

Regards,
"D"
Mar 18 '11 #1
2 1974
acoder
16,027 Expert Mod 8TB
Can I see your tab code or perhaps a test page?
Mar 18 '11 #2
Soniad
66
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"
Mar 25 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: philjhanna | last post by:
Hi I'm having a problem applying return false to a div via addEventListener. I'm adding this so that I can drag (click-hold-move) over an image. (Its so that I can add zooming to the image)...
2
by: philjhanna | last post by:
Hi, Does anyone know why I can't add return false with addEventListener in firefox (1.0.6). This demonstrates the problem If return false is added to onmousedown then you can drag over the...
1
by: james.kingston | last post by:
I've read that one must return false from an onclick handler attached to an anchor if we wanted to prevent the browser from following the href. In a greasemonkey script I'm hacking together with...
13
by: kurtj | last post by:
Hello Gurus: I have a validation script (below) that is somehow messed up. If the Name field is blank, I get the alert message, then the browser window goes to a blank document with the word...
8
by: Peter Afonin | last post by:
Hello, I'm using Javascript in ASP.NET application to check whether at least one checkbox in datagrid has been checked. If validation fails, the user gets a warning. If he clicks OK, the form is...
8
by: vunet.us | last post by:
Why does IE6 ignores JavaScript's return false on a link and how to fix it? Firefox works perfect! <a href="page1.html" onclick="return test(this)">Test</a> JS: function test(obj) {...
2
by: FunkHouse9 | last post by:
I have 2 functions, the first one, "GetSelectedItem" is determining which radio button was selected and running the "formvalidation" function if needed. This is working fine. My problem is getting...
1
by: prashanth023 | last post by:
Hi, This is prashanth kumar. I am getting error , i am gettign number of records using ajax. Please solve this if n >0 i am putting return false in response function. but form is going to...
1
by: ashwiniappajigowda | last post by:
Hi, I have an simple MFC dialog based application. On launch of that application 'Password protected screen saver' is not getting activated after the screen saver timeout. If 'On resume,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.