I have reviewed other posts out there and have found this coding to add or remove a required status based on a checkbox. Wondering how I would alter it to be based on a field value? I have a field (q15) on my form that contains a formula that returns a TRUE or FALSE value based on other fields.
I want a certain field (q79) to be required if my formula comes back as TRUE and not required if it is false.
$(document).ready(function () {
$('.checkbox input').change(function () {
if ($(this).is(':checked')) {
$('.req span.cf-required').remove();
$('.req input').removeClass('required').removeAttr('required');
} else {
$('.req label').append('<span class="cf-required">*</span>');
$('.req input').attr('required', 'True');
}
})
});
Thanks in advance for any help you can provide.