So how many times have you built a PHP form processing script and ended up with dozens of duplicate database entries, duplicate mail sent etc...?
I've been diggin this for the last 48 hours and it was hell. the net is flooded with snippets of code that just won't do it!
Mainly javascript. All the wiseasses will come to you and say "Just add onclick="this.button=disabled;" to your submit button and this should do it".
Well I've got news for you -- This WILL disable the button upon click but won't submit the form.
The following code, is the only thing that works, this after days of digging. trust me!
Make your button like this:
<input type="button" value="Submit" onclick="this.form.submit();this.disabled=true;this.value='Processing'" />
This will submit the form, disable the button and turn the text in it to "Proccessing" so that the user will understand what the hell is going on.
Enjoy!
Simba.