Avoiding double click in jQuery with ASP.NET

Posted by Sheonarayan under jQuery category on | Points: 40 | Views : 2050
To avoid double click of Submit button on the web page, you can use below code snippet.


$('#<%= btnSave.ClientID %>', this).attr('disabled', 'disabled');

Here #Form1 is the id of the HTML form, btnSave is the id of the asp.net submit button.

In the same way if you have more than one button on the page that submits the page, you can change the jQuery selector $('#<%= btnSave.ClientID %>', this) part of the code.

However if you are using ASP.NET Validation control on the page, the above method will not work as desired. So use this approach, read this article



Comments or Responses

Posted by: Raja on: 2/18/2015 Level:Starter | Status: [Member] | Points: 10
Good one Sheo. Thanks for sharing.

Login to post response