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
edwardk091997Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

martinagCommented:
<FORM onSubmit="if(this.sent)return false;this.sent=1">
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
edwardk091997Author Commented:
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
0
martinagCommented:
<FORM onSubmit="if(this.sent)return false;this.sent=1;return true">
0
edwardk091997Author Commented:
Thanks!

works with every browser except IE 3.0

anything that can be done to fix that?

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

Ideas..workarounds?


0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.