开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜