Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Can Javascript stop 'double click' of form buttons?

Posted on 1998-11-02
5
Medium Priority
?
713 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 150 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
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…

688 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