Home Hide/Display a input field based on value from HtmlRadioButtonFor and make it mandatory if display

# Hide/Display a input field based on value from HtmlRadioButtonFor and make it mandatory if display

1#
Pradvaar cruz Published in 2017-09-12 16:14:23Z
 I have a scenario where I have two different div's and the later should disappear based on boolean value from earlier div. if the radiobutton value is true, later div should be a required filed. Actual Code: 

Is Employment Offered? *

 
 Change it to "True": $("#employeeNumber").hide();$("input[name='IsOffered']").on("change", function () { if ($(this).val() === "True") {$("#employeeNumber").show(); } else { \$("#employeeNumber").hide(); } });  Because Boolean.ToString() returs "True" instead of "true". So this value is added to the radio that is generated by razor. Why?