InfoGears Inc. Logo
InfoGears () noun. Flexible, affordable software modules that seamlessly work together to provide powerful business solutions.
 Home   |   Request More Information   |   Success Stories 
Customer Login:
Username:
Password:
Prevent Double Form Submits (Clicks) Using Javascript
Author: Josh Rosenbaum
Comments/Questions? Contact us here.


Introduction:
This js file will allow you to easily disable double submits of forms for a designated length of time after the first click. It will also display a countdown of the time next to the button.

Usage:
<form name="myform32">
<input value="Submit Form" name="myname" onclick="return disable_double_click(this.form.name, this, 5000);" type="submit">
</form>

Notes:
  • 5000 is the time (in milliseconds) to stop double clicks on the button.
    (5000 milliseconds = 5 seconds.)
  • Your form must be named.
  • All buttons in a form that use the safe protect code will be 'disabled' for the specified duration after the initial click.

Demo: 
  
This demo is not an actual submit, but the alerts will simulate what would happen.


If you have any modifications to make this code better, please use the InfoGears contact form.

Read the headers in the file for details.
If you want others to see this file, please link back to this page rather than copying the file to your server.
Download Version 0.2 of form_protect.js

Contact Us | Privacy Policy | Service Agreement | Spam Policy
© Copyright 2007 InfoGears Inc. P.O. Box 6701 Bozeman, MT 59771-6701 406.582.1200
Powered by InfoGears
Valid XHTML Valid CSS Made for Firefox