webressurs
asked on
Prevent double submit when users doubleclick an asp:button
When users doubleclick an asp:button the form is added twice in the database. What is the best and easiest way to prevent this?
Can it be done in the Stored Procedure (SQL)? Or by using Jquery? Or code behind by disabling the button on submit?
Hope some of you experts can give me a good advice :)
Can it be done in the Stored Procedure (SQL)? Or by using Jquery? Or code behind by disabling the button on submit?
Hope some of you experts can give me a good advice :)
in your submit code, verify if the same record exists (eg only the previous record or a record submitted in the last x seconds), you can also add an identifyer and check if that exists.
if there is no result, you can create a new record
if there is no result, you can create a new record
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Disables button when clicking it.
to prevent it from happening you would need to try to detect the double submit issue - like, for instance, not honoring two subsecond requests in a row with the same exact data in the same exact session.