Solved

Can Javascript stop 'double click' of form buttons?

Posted on 1998-11-02
5
704 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
sort Multi-dimensional array 6 45
Boolean 13 51
What kind of script/language created this graph? 6 67
How does GeoJson relates to Leaflet and Mapbox? 4 50
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 implement server side field validation and display customized error messages to the client.
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…

752 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