I have this code that will set and disable the QA Project Support checkbox if Specification = Yes:
$(document).ready(function(){ //check the QAE box and disable if specification = yes $('.specification input').change(function () { if ($(this).val() == "Yes") { $("#Field104-2").prop("disabled", false); //Enable so it can be changed $('#Field104-2').attr('checked', true).change(); //QAE is Not Required $("#Field104-2").prop("disabled", true); //Disable so it cannot be changed } else { $("#Field104-2").prop("disabled", false); //Enable so it cannot be changed } }); $(".specification input:checked").each(function(){ $(this).trigger('change'); }); });
The first time I use it, works great:
Then the user decides to say NO. It doesn't uncheck but it does enable it for the user to decide. Again ... still working great!
It allows me to uncheck it .... again, working as designed!
Here's the issue. When the user decides to change Specification = Yes again, it disables, but it doesn't set the checkbox to checked:
Any ideas? Thanks in advanced!