We upgraded to Ver. 11 this past January. Since the upgrade, I have had issues with "Ignore the data when the field/section/page is hidden" not working. so I'm trying to replace with Javascript. An upgrade to Ver. 12 might help, but that won't happen for another year or so. I need to do this to all required fields that get hidden in a Field Rule. Anyway, there are two fields in my Form I'm working with initially. If I can get this to work, I can do the same for all other applicable fields:
I had originally set up the following Field Rule:
Since upgrading to Ver. 11, it doesn't let me continue to the next Form, so I deleted the Field Rule and am trying to use javascript to do the same thing. I removed "required" from the "candidate" field and added the following javascript:
$(document).ready(function(){ //set fields to hidden $('.candidate').hide(); //Instead of Field Rules, for Request Type $("input[id^=Field22-0]").change(function () { // Request Type = New Request if ($(this).is(':checked')){ $('.candidate').show(); $('.candidate input[type="radio"]').attr('required', true); $('.candidate .cf-label').append('<span class="cf-required">*</span>').change(); } }); $("input[id^=Field22-1]").change(function () { // Request Type = Change Order if ($(this).is(':checked')){ $('.candidate').removeClass('required'); $('.candidate input[type="radio"]').removeAttr('required'); $('.candidate').hide(); } }); $("input[id^=Field22-2]").change(function () { // Request Type = Renewal if ($(this).is(':checked')){ $('.candidate').removeClass('required'); $('.candidate input[type="radio"]').removeAttr('required'); $('.candidate').hide(); } }); $("input[id^=Field22-3]").change(function () { // Request Type = Termination if ($(this).is(':checked')){ $('.candidate').removeClass('required'); $('.candidate input[type="radio"]').removeAttr('required'); $('.candidate').hide(); } }); }); //close document.ready
My issue is that if someone toggles from New Request to Change Order, it adds another asterisk. How do I delete the extra asterisks?
I would really like the Field Rule to work properly because writing javascript to do this is way more work. Any suggestions.