Hello there, I have the following drop down list in my frontend code:
@Html.EJ().DropDownList("schoolStatusList").Datasource((IEnumerable<ELLBooking.Models.ControlInfo>)Model.Where(m => m.ControlName == "SchoolStatus").ToList()).DropDownListFields(df => df.ID("ControlID").Text("ControlValue").Value("ControlValue")).Value(Model.Where(m => m.ControlID == ViewBag.datasource.PreviousSchoolStatus.ToString()).Select(m => new { m.ControlValue }).Single().ControlValue.ToString()).ClientSideEvents(evt => evt.Change("onChange"))
I have a Javascript function to hide div id = wDate1 and wDate2 (shown below) .
It only works after the form is fully loaded, and when I change the value of the drop down list manually.
<script>
function onChange(args)
{
if (args.text == "Withdrawn")
{
$("#wDate1").show();
$("#wDate2").show();
}
else
{
$("#wDate1").hide();
$("#wDate2").hide();
}
}
</script>
What is still missing is that if the dropdown list's value is "Withdrawn" upon loading, I need to hide wDate1 and wDate2 divs after rendering.