Solved

Can Javascript stop 'double click' of form buttons?

Posted on 1998-11-02
5
699 Views
Last Modified: 2008-03-17
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
0
Comment
Question by:edwardk091997
  • 3
  • 2
5 Comments
 
LVL 4

Accepted Solution

by:
martinag earned 50 total points
ID: 1273414
<FORM onSubmit="if(this.sent)return false;this.sent=1">
0
 

Author Comment

by:edwardk091997
ID: 1273415
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
 
LVL 4

Expert Comment

by:martinag
ID: 1273416
<FORM onSubmit="if(this.sent)return false;this.sent=1;return true">
0
 

Author Comment

by:edwardk091997
ID: 1273417
Thanks!

works with every browser except IE 3.0

anything that can be done to fix that?

Keith Kwiatek
0
 

Author Comment

by:edwardk091997
ID: 1273418
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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now