Not all CGI programs, few in fact, check for double form submissions, those submissions that happen when a user clicks a form submit button more than once.
A feature missing from all click trappers I’ve seen, until now, is the ability to release the trap after a certain amount of time has elapsed.
Suppose someone uses your project estimate form. When the submit button is clicked, the click trap is set so it can’t be submitted again.
However, after submitting the form, the user realizes more information should be provided and uses the browser’s “back” button to return to the form.
The trap is set. The submit button won’t respond.
If the trap had been released after say, 10 seconds, the user could have submitted the new information.
The number of seconds can be adjusted. You want it high enough to disable the submit button for those impatient ones who click repeatedly. Yet, you want it low enough so the lock releases in time for those who return to change information.
When the trap is set and the user clicks the submit button, a popup box with your content can pop up.
The first time the submit button is clicked, the text in the submit button can change.
The number of seconds must be specified in the script, but the list of three items above are all optional.
If you use any quotation marks in the alert box message itself, precede them with a backslash character, like: Click the \”Ok\” button.
To cause a line break, use the backslash character and lower-case n character pair. To cause a blank line, type the pair twice, like: “Hello!\n\nAgain!”
If you do not want to display an alert box, simply remove any message between the quotation marks.
Submit Button Text Change
If you want the text of the submit button to change when it’s first clicked, “Now Processing …” for example, or “Stop! Not again!”, three items of information must be provided:
The form’s name. This is the name=”______” you have in your FORM tag. If you don’t have one, put one in. Example:
The submit button’s name. This is the name=”______” you have in your submit button tag. If you don’t have one, put one in. Example:
The new text for the submit button.
Note that the new submit button text should be no longer than the original. That’s because some browsers won’t enlarge the submit button even if not all of the text will fit.
To implement this Double Click Trapper, download the working example from http://willmaster.com/a/21t/pl.pl?art211 and then:
attribute into the submit button tag. Example:
Then, upload the page to your server and test it.
And may it reduce your frustration while never increasing the frusration of the user.