html form button to stop mutilple submissions

leonards

New Member
I have this form that submits to \[code\]work.php\[/code\].What I want to do is disable the submit button when the form is submitted, then re-enable it after 5 seconds or so, so I don't get multiple posts.How can I do this?Also, if I press the enter key in one of the text boxes while the submit button is not clickable then it will redirect me to \[code\]work.php\[/code\] which don't want to happen.\[code\] <form method="post" action="work.php"> <strong>Message:</strong> <input type="text" id="message" name="message" class="message" /> <input type="submit" id="submit" onClick="this.value='http://stackoverflow.com/questions/7575829/Processing form';this.disabled=true;if(Submitting()){this.form.submit()}else{this.value='http://stackoverflow.com/questions/7575829/Submit';this.disabled=false;}" value="http://stackoverflow.com/questions/7575829/Submit" /></form>\[/code\]
 
Top