View Single Post
Old 10-11-2012, 11:38 PM   PM User | #2
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,178
Thanks: 59
Thanked 3,995 Times in 3,964 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
Shouldn't really be working in FF.

When you call a <form>s submit() function, you *BYPASS* the onsubmit!

I suppose it is working in FF because you have TWO bugs. You are *BOTH* calling the <form>'s onsubmit() function *AND* you are *NOT* suppressing the action of the submit button. So FF ends up submitting the form *TWICE*.

It's an easy fix:
Code:
<input type="submit" name="okButton" id="okButton" class="shortButton" value="OK" 
    onclick="this.disabled=true;this.form.cancelButton.disabled=true;return true;"/>
if you simply do return true from a submit button, then the <form> will be submitted as normal and the onsubmit function will be called.

Notice also how you can shorten your code that disables the form fields.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is online now   Reply With Quote