posted 10/22/2009 by Sumit Arora
In this blog i will explain you how to enable/disable textbox using jquery.
<html xmlns="http://www.w3.org/1999/xhtml"> <head > <title></title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> </head> <body> <form id="form1" runat="server"> <div> <input id="txtName" type="text" value="disabled" /> <asp:Button ID="btnCancel" runat="server" Text="Cancel" /> </div> </form> </body> <script type="text/javascript"> $(function() { $('#txtName').attr('disabled', true); }); $('#<%=btnCancel.ClientID %>').click(function(e) { e.preventDefault(); $('#txtName').val('enabled'); $('#txtName').removeAttr('disabled'); }); </script> </html>
That's all!
What kind of email newsletter would you prefer to receive from CodeAsp.Net?18