edwardk091997
asked on
Can Javascript stop 'double click' of form buttons?
Hello,
I have a situation where the user clicks on the form button, which causes the "order information" to be passed to a cgi. In turn, the cgi validates the order information, closes the order, and then displays a confirmation to the user...
BUT, if the user double clicks on the form button, the first cgi call completes, --and the user NEVER gets to see the confirmation number...BECAUSE the second call to the cgi completes and can not complete the order!
Can I use javascript to create a form button that will only send the form information ONCE, regardless of how many times the user clicks the button? OR is there a better solution?
THANKS!
Keith Kwiatek
Thanks
Keith Kwiatek
I have a situation where the user clicks on the form button, which causes the "order information" to be passed to a cgi. In turn, the cgi validates the order information, closes the order, and then displays a confirmation to the user...
BUT, if the user double clicks on the form button, the first cgi call completes, --and the user NEVER gets to see the confirmation number...BECAUSE the second call to the cgi completes and can not complete the order!
Can I use javascript to create a form button that will only send the form information ONCE, regardless of how many times the user clicks the button? OR is there a better solution?
THANKS!
Keith Kwiatek
Thanks
Keith Kwiatek
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
<FORM onSubmit="if(this.sent)ret urn false;this.sent=1;return true">
ASKER
Thanks!
works with every browser except IE 3.0
anything that can be done to fix that?
Keith Kwiatek
works with every browser except IE 3.0
anything that can be done to fix that?
Keith Kwiatek
ASKER
when using IE 3.0 it doesn't give a javascript error, but doesn't work either....seems to just ignore it....
Ideas..workarounds?
Ideas..workarounds?
ASKER
I need something that works with IE and NS 3 and 4