onclick="this.disabled=true;this.form.submit();"
put this at the end of your submit button.
sample code
<input type="submit" value="Submit" onclick="this.disabled=true,this.form.submit();" />
onclick="this.disabled=true;this.form.submit();"
put this at the end of your submit button.
sample code
<input type="submit" value="Submit" onclick="this.disabled=true,this.form.submit();" />
3 comments:
yes .it avoids double clicking of submit button but u can go back to form through the browser (back) button which it can submit again.......
if that is the case then disable the browser back button.
If you are using spring or struts , you can use token mechanism to handle double click issue.
I think the previous comment authors are missing the point of the script. Isn't it supposed to prevent 'accidental' double clicking? Sometimes, if a form is submitted twice, the consequences could be disastrous. You could be ordering the same merchandise twice!
Post a Comment