asked on May 10, 2017
On form open, if Specification = Yes, I'd like the QAE field to be required.
I have it coded to also set QAE to required when Specification is changed to yes and not required when Specification is changed to no. On change is working fine ... on form open doesn't work. What am I doing wrong? Here's the code:
$(document).ready(function(){ //set QAE to required if specification = yes $(".specification input:checked").each(function(){ $('.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'); } }); }); }); //close document.ready
0
0