Disable button on submit using javascript to prevent double clicking

Disable button on submit instead of onclick

Use this code?

Button is not firing postBack because you have disabled this. The approach to avoid multiple postBack is to have two buttons side by side. Real and dummy. On first click hide/delete the real button and show the dummy one
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" ClientIDMode="Static" OnClientClick="disableButton();"/>

<asp:Button ID="ButtonDummy" runat="server" Text="Button" ClientIDMode="Static" OnClientClick='return false;' style="display:none;"/>
and JS:
function disableButton() {

 $("#Button1").hide();

 $("#ButtonDummy").show();

 return true;
 }
shareimprove this answer

Hacking and debugging tools

http://www.asjava.com/tools/fiddler-tutorial-how-to-use-fiddler/

Illuminations and firebug: it’s aware of popular JS frameworks such as Ext.js, Angular, etc.

DBVisualiser: allow you to edit rich text and images in vast amount of databases. http://www.dbvis.com/

RegExr: to test and visualize regex: http://regexr.com/

XPath Visualiser: to test and visualize XPath for XML query: http://xpathvisualizer.codeplex.com/

WinMerge: to compare files to find differences.

Visual Studio Web Essentials plugin: add useful features for JS development such as #region