how to handle Dropdownlist SelectedIndexchanged event in ASP.Net MVC
!{Html.TextBox("registerDetails.OtherCompanyActivity", registerModel.EditForm.OtherCompanyActivity, new { @class = "further_info", @tabindex = "15" })}
this is my dropdownlist. And when i have selected a v开发者_JAVA技巧alue in the dropdownlist , the textbox should be made readonly.
Use JavaScript
add/bind OnChange event to the dropdown list
OtherCompanyActivity", registerModel.EditForm.OtherCompanyActivity, new { @class = "further_info", @tabindex = "15", onchange="dpwnChnaged()" })}
Check the value change from default value and make the text box ReadOnly by adding ReadOnly attribute to text box
I would prefer JQuery
精彩评论