I have an SSN field that is required. If the user selects Yes --- POA Mailed In then the SSN is not required. If the user selects No --- POA Mailed In then the SSN is required. How do I hide the error message Please fill out this field and make the box not red? I can remove the asterisk and make the field not required.
//If POA Mailed In = Yes, hide and un-require field
//If POA Mailed In = No, un-hide and require field
$('[name="Field224"]').change(function () {
if($('#Field224-0').prop("checked")==true) {
$('.reqField input').removeAttr('required');
$('.reqField span.cf-required').remove();
}
else if($('#Field224-1').prop("checked")==true) {
$('.reqField label').append('<span class="cf-required">*</span>');
$('.reqField input').attr('required', 'True');
}
});
Thank you!!!!!