Link to home
Start Free TrialLog in
Avatar of edwardk091997
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
ASKER CERTIFIED SOLUTION
Avatar of martinag
martinag

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of edwardk091997
edwardk091997

ASKER

when I try this I get "function does not always return a value"

I need something that works with IE and NS 3 and 4
<FORM onSubmit="if(this.sent)return false;this.sent=1;return true">
Thanks!

works with every browser except IE 3.0

anything that can be done to fix that?

Keith Kwiatek
when using IE 3.0 it doesn't give a javascript error, but doesn't work either....seems to just ignore it....

Ideas..workarounds?