Ed Jay wrote:
Quote:
Despite searching the net, I can't find a suitable solution that
prevents a user's double click from submitting a form twice. I'm
currently using the following in a button element:
>
<input type="button" onclick="this.disabled=true;this.form.submit();">
>
While it prevents multiple single clicks, it isn't good enough for a
fast double click, such as found on some multi-button mice.
>
Anyone have a better solution?
>
The only and best way to ensure this isn't an issue, is coding the
script to only execute the necessary functions on the first click. All
of the logic must be done in the script, and it's always best to code
scripts to not create a problem if a user was to submit the form over
once. Things like JavaScript on the browser end probably won't hurt,
but shouldn't be relied upon. Use some custom session instead and
control what happens and anticipate the things such as a double
submission.
--
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting. 24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!