0
!{Html.TextBox("registerDetails.OtherCompanyActivity", registerModel.EditForm.OtherCompanyActivity, new { @class = "further_info", @tabindex = "15" })} 

this is my dropdownlist. And when i have selected a value in the dropdownlist , the textbox should be made readonly.

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.