How to disable Asp.net Button with Jquery?





How to disable Asp.net Button with JQuery?

Following java script function disables an asp.net button. Tested in IE 7

<asp:Button ID=”Button1″ runat=”server”  Text=”Disable me” OnClientClick=”disAbleMe()” />

function disAbleMe() {
$(“#<%=Button1.ClientID %>”).attr(“disabled”,”true”);

}

You can try other attributes too.




Tags: , , , ,

One Response to “How to disable Asp.net Button with Jquery?”

  1. Fawad says:

    Thanks, helped a lot 🙂