I have a asp.dropdown list set enabled=false, is it posible to modify through javascrip to enabled=true? This should happen after a Textbox has a value in it.
1 Answer
Do you mean Enabled="False"? If so, no you cannot - you must do this from the code behind. You are getting the server attributes and client attributes confused. Enabled is not the same as disabled for the client side. You cannot change the server variable Enabled on a runat="server" tag.
3 Comments
Martin Parenteau
Good answer. I thought about the effect on the button, and did not consider the
Enabled property itself, as I should have done.Abel C
Thanks now I understand why my code was not working. I did not know there were two sets of attributes, I thought they were just called different. Any way gotta re-write code, different approach needed.
AlphaG33k
No problem I also found (and still find) Web Forms confusing at times. I welcome the day where I can work exclusively in MVC & MVVM architectures :)
disabledproperty: w3schools.com/jsref/prop_select_disabled.asp