Solved

Can Javascript stop 'double click' of form buttons?

Posted on 1998-11-02
5
697 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
Comment Utility
<FORM onSubmit="if(this.sent)return false;this.sent=1">
0
 

Author Comment

by:edwardk091997
Comment Utility
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
Comment Utility
<FORM onSubmit="if(this.sent)return false;this.sent=1;return true">
0
 

Author Comment

by:edwardk091997
Comment Utility
Thanks!

works with every browser except IE 3.0

anything that can be done to fix that?

Keith Kwiatek
0
 

Author Comment

by:edwardk091997
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Problem to Popup 2 48
Java Server Faces parameter pass? 6 18
getting id from database 5 24
jqplot Pie Chart 2 11
The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…

772 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

10 Experts available now in Live!

Get 1:1 Help Now