Solved

Can Javascript stop 'double click' of form buttons?

Posted on 1998-11-02
5
701 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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…

786 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