With some help, I was able to set up this code where it sets QAE to required if Specification = Yes OR, if I toggle the field, it will turn Required on and off for QAE.
$(document).ready(function(){
//set QAE to required if specification = yes
$('.specification input').change(function () {
if ($(this).val() == "Yes")
{
$('.qae label').append('<span class="cf-required">*</span>');
$('.qae input').attr('required', 'True');
}
else
{
$('.qae .cf-label span.cf-required').remove();
$('.qae input').removeClass('required').removeAttr('required');
}
});
$(".specification input:checked").each(function(){
$(this).trigger('change');
});
}); //close document.ready
It works great except for one issue. If I set Specification = No, it removes the * but I still see "Please fill out this field." It's no longer required and should not be showing this way. Please assist.