tags:

views:

190

answers:

2

The ASP.NET DropDownList has the property Enabled="false", but is it possible from jQuery to set the property to Enabled="true"?

+2  A: 
$("input").attr("disabled", "false");

In this situation, I would assign (I'm assuming that you're using .Net webforms) a CssClass to the input, then use that CssClass as the selector. Since you can't set the server property once the page has been rendered, you have to use the DOM "disabled" parameter; so instead of enabled=true, you'd have to set disabled=false.

Plan B
+8  A: 

Do you mean the ASP.NET control DropDownList and the server property "Enabled"?

ASP.NET renders a DropdownList server control with enable="false" this way:

<select id="myDropDownListId" name="myDropDownListId" disabled="disabled">

So, you could use this jQuery snippet to remove that attribute:

$('#myDropDownListId').removeAttr('disabled');
splattne
Thank you very much that worked!