Friday, 29 April 2016
Enable,Disable textbox or combobox or textarea using ASP.Net,JQuery
I will explain about how to enable or disable user controls like textbox, textare, dropdownlist, combobox, datepicker ,etc.. using Asp.Net and Jquery.
Using Asp.Net there is an property for enable a controls as Enabled=true/false
<asp:TextBox ID="txtbox" runat="server" Width="50%" CssClass="form-control" Enabled="false"></asp:TextBox>
<input type="textbox" id="txtbox"/>
Using Jquery there is an property called as disabled(true/false)
$('[ID$=txtbox]').attr('disabled',true); //This is for asp.net controls
$('#txtbox').attr('disabled',true');//This is for html controls
Using Asp.Net there is an property for enable a controls as Enabled=true/false
<asp:TextBox ID="txtbox" runat="server" Width="50%" CssClass="form-control" Enabled="false"></asp:TextBox>
<input type="textbox" id="txtbox"/>
Using Jquery there is an property called as disabled(true/false)
$('[ID$=txtbox]').attr('disabled',true); //This is for asp.net controls
$('#txtbox').attr('disabled',true');//This is for html controls
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment