I have multiple forms. Throughout the process, users have the ability to set or change the Specification field to either Yes or No. Once it hits the Engineering Manager (EM) role, when the EM's form loads, it must evaluate what was chosen for that radio button. If it's "yes", it must set another field (qae) to required.
$(document).ready(function(){ //set QAE to required if specification = yes if ($('.specification input').val() == 'Yes') { $('.qae label').append('<span class="cf-required">*</span>'); $('.qae input').attr('required', 'True'); } else { $('.qae span.cf-required').remove(); $('.qae input').removeClass('required').removeAttr('required'); }; });
It's not working. I'm sure I'm doing something wrong! It worked great when I initially had on "on change" but then I had to allow previous users to answer that question.