Home › Forums › CSS › Custom Drop down with check boxes › Reply To: Custom Drop down with check boxes
June 24, 2015 at 10:14 am
#204131
Participant
<label class=”control-label” for=”FIPS”>County</label> @Html.DropDownListFor(Model => Model.CountyId, new SelectList(counties, “Key”, “Value”), “”, new { @class = “form-control”, id = “countyValue” })
var initiateDropDownListShortAndLong2 = function (ddlShort) {
$(ddlShort).on({
change: function (event) {
$(ddlShort + ' option:first-child ').html($(ddlShort).val());
$(ddlShort + ' option:first-child ').val($(ddlShort).val());
$(ddlShort).prop('selectedIndex', 0);
}
});
};
$(document).ready(function () {
initiateDropDownListShortAndLong2(‘#countyValue’);
});