<script type="text/javascript"> function showHideDivs(elem) { var divsObj = document.getElementsByClassName('showHideDivs'); for (i = 0; i < divsObj.length; i++) { divsObj[i].style.display = (divsObj[i].id == 'd' + elem.value) ? 'block' : 'none'; } } </script> <div class="editor-label"> @Html.LabelFor(model => model.custMain.CTypeID) </div> <div class="editor-field"> @Html.DropDownListFor(model => model.custMain.CTypeID, (IEnumerable<SelectListItem>)ViewBag.ClientType, "Select Client Type", new { @class = "showHIdeDivs", @onchange = "showHideDivs(this)", id = "cid" }) @Html.ValidationMessageFor(model => model.custMain.CTypeID) </div> <div class="showHideDivs" id="d1"></div>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)