I have a dropdown which has a value of "Yes" or "No." I have a field that is required if the user selects "No" but even if I choose "Yes" the field still wants a required input. I am using jquery to achieve this but it is still not working. My code is below.
<script type="text/javascript">
$('ddlBlueStake').change(function () {
if (this.value == 'No') {
$('txtBlueStakeComm').prop('required', true);
} else {
$('txtBlueStakeComm').prop('required', false);
}
});
</script>
On my field I am calling required="true"
<asp:TextBox ID="txtBlueStakeComm" runat="server" TextMode="MultiLine" required="true" CssClass="required"></asp:TextBox>
Any help would be appreciated.
tag but now the form will not submit. No error now but it still will not submit correctly.
– Philip Herman Nov 13 '20 at 17:16