Friday, May 10, 2024
 Popular · Latest · Hot · Upcoming
159
rated 0 times [  163] [ 4]  / answers: 1 / hits: 16656  / 15 Years ago, mon, april 13, 2009, 12:00:00

Consider the following form:


<form action="/a" method="post"> 
<input name="x" type="text" onblur="myonblur(e)" />
<input name="y" type="text" />
<input name="submit" type="submit" value="Submit" />
</form>

When focus is on element with name "x" and user presses submit button, onblur event fires but form is NOT submitted. Is there any way to make submit button work as expected if I have onblur events in my form?


More From » forms

 Answers
46

Consider optimizing your onBlur() method so it takes less time to run. If your form is prevented from getting submitted, it might be because the onBlur() is too long and hangs the browser from doing anything else.



You can also use the onChange() method instead of onBlur(). That may work better for you.


[#99716] Sunday, April 5, 2009, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
nestorjarettg

Total Points: 451
Total Questions: 108
Total Answers: 108

Location: Rwanda
Member since Thu, Feb 10, 2022
2 Years ago
;