How do you stop users from clicking the submit button more than once?
If there is a form submission that may take a while, many users will click the submit button multiple times. One way to prevent that from happening is to add a bit of javascript to a form button that disables the button on the first submit. For example:
<INPUT TYPE="Button" VALUE="Submit" onClick="if(this.value == 'Submit') this.form.submit(); this.value = 'Please Wait.';this.disabled=true;">
Of course this depends on Javascript being turned on in the user's browser. Another option is to use ColdFusion's built in form handling with
<cfinput type="submit" name="submit" value="Submit" validate="SubmitOnce">
This question was written by Larry C. Lyons
It was last updated on January 11, 2006.