I have three DropDownLists. If a specific value is selected from my first DropDownList, you need to include a second unpack list. For example, if "Player 3" was selected, the other two DropDownList should be enabled, although if "Player 2" was selected, the last DropDownList should be disabled and the second enabled.
How can i do this? First I use MVC 3 EF. This is my code, in my opinion:
<p>Player</p>
<div class="editor-field">
@Html.DropDownListFor(m => m.PlayerName,Model.SubjectTypes, "Choose player" , new { @class = "selectstyle" })
@Html.ValidationMessageFor(model => model.PlayerName)
</div>
<p>Position</p>
<div class="editor-field">
@Html.DropDownListFor(model => model.PositionName, Model.Consultants, "Choose Position", new { @class = "selectstyle" })
@Html.ValidationMessageFor(model => model.ContactPerson)
</div>
<p>Team</p>
<div class="editor-field">
@Html.DropDownListFor(model => model.TeamName, Model.Teams, "Choose Team", new { @class = "selectstyle" })
@Html.ValidationMessageFor(model => model.ContactPerson)
</div>
source
share