473,395 Members | 1,948 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,395 software developers and data experts.

Onblur prevents onsubmit while submitting form.

i have validation functions which is being called on onblur of respective input field. at the same time i am calling same validation functions with one say 'validateall()' function and 'validateall()' is being called on 'onsubmit'.
now the problem is if some error has occured and i have corrected it and submit the form at that time 'onblur' is being called which is preventing from calling 'onsubmit' event.
this problem i am facing in Firefox only.
please help me out, its very urgent.

Thank u in advance.
Feb 7 '13 #1
5 2391
Rabbit
12,516 Expert Mod 8TB
We would need to see your code.
Feb 7 '13 #2
Expand|Select|Wrap|Line Numbers
  1. function validateFormOnSubmit(theForm) 
  2. {
  3. vUsername(theForm.userName,document.getElementById('UError'));//this will return true or false depends on error occurrence. 
  4. }
  5.  
  6.  
  7. <form name="form" onsubmit="return validateFormOnSubmit(this);">
  8. <input type="text" id="userName" onblur="vUsername(this,UError);">
Feb 8 '13 #3
Rabbit
12,516 Expert Mod 8TB
Please use code tags when posting code.

Your validate code needs to return the value from the username function. If that doesn't work, we need to see the code for your username function.
Feb 8 '13 #4
Rabbit
VUsername will return count of error and depend on that count validateFormOnSubmit() will return true or false.
Feb 8 '13 #5
Rabbit
12,516 Expert Mod 8TB
Perhaps that's what you want it to do. What I've been trying to tell you is that your validateFormOnSubmit() function doesn't return anything.
Feb 9 '13 #6

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

Similar topics

4
by: Kai Grossjohann | last post by:
I have two frames. Frame "search" contains a search form specifying an onsubmit action like so: <form ... onsubmit="foo();"> ... </form> The other frame contains a <img ......
2
by: Matthew Lybanon | last post by:
If this is not the correct newsgroup, please direct me to one better suited to my request. I have created a simple online survey (using a form) for a club. For several reasons we prefer to have...
0
by: simo sentissi | last post by:
Hello I have a popup window that I would like to keep on top so I am using the foloowing javascript: window.onblur = function() { setTimeout('self.focus()',100); } it keeps my popup...
4
by: roxanaislam | last post by:
Submitting Form by pressing the "ENTER" key -------------------------------------------------------------------------------- Hi: I have a search form in my application which has 4 dropdown...
18
by: Axel Dahmen | last post by:
Hi, trying to submit an ASPX form using the key (using IE6) the page is not submitted in my web project. Trying to debug the pages' JavaScript code I noticed that there's some ASP.NET client...
18
by: NavinM | last post by:
I have a couple of forms that are misbehaving in FireFox, but work fine in IE. when i do submit( with submit button) a javascript function validates all of the fields entered, and stops the...
1
by: pechar | last post by:
Hi all, I'm absolutely lost and have no idea why this is happening. I have a master page where the form resides. I set an onsubmit attribute to call a method which sets a variable to true ...
1
Claus Mygind
by: Claus Mygind | last post by:
I am having some trouble submitting a form in IE. Works fine with FireFox. I have tried two methods. method #1 function validateForm(form) { if (document.getElementById("NAME").value...
2
by: rudiedirkx | last post by:
Gents, I have a problem (only in Safari) with the onsubmit in webforms. This topic covers the same subject: http://bytes.com/topic/javascript/answers/166542-onsubmit-safari but not as detailed as...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.