preventing form double-submits - the plot thickens
Posted: Mon Mar 05, 2007 6:20 pm
I know this isn't strictly PHP, but I figure someone will know the answer anyway.
I have a load of HTML forms, and I don't want double-submits, so I did the old button-turns-grey-after-you-click-it technique.
I had to add the form.submit() bit because Safari wasn't actually submitting for some reason.
Now, here's the problem. A lot of users click back and change something when a form doesn't work because they didn't fill it out properly. The buttons are still grey when I go back. Is there a way to ungrey them when the user goes back to the page? This is rather perplexing, because it doesn't seem like a load event would even be called.
Maybe I'm just doing this wrong? I'd rather not do checking on the server-side, for various reasons.
I have a load of HTML forms, and I don't want double-submits, so I did the old button-turns-grey-after-you-click-it technique.
Code: Select all
<input type="submit" value="Sign up!" onclick="this.disabled = true;form.submit()">Now, here's the problem. A lot of users click back and change something when a form doesn't work because they didn't fill it out properly. The buttons are still grey when I go back. Is there a way to ungrey them when the user goes back to the page? This is rather perplexing, because it doesn't seem like a load event would even be called.
Maybe I'm just doing this wrong? I'd rather not do checking on the server-side, for various reasons.