fd.rendered(function() { //clear form cache fd.clear(); //hide grid containers on form load $('.Box1').hide(); $('.Box2').hide(); var radio = fd.field('rbChoice'); //show or hide grid containers when selecting values radio.$on('change', function(value) { if(radio.value.includes('Choice 1') == true) { //show chg-cost-center grid container $('.Box1').show(); $('.Box2').hide(); } if(radio.value.includes('Choice 2') == true) { //show chg-cost-center grid container $('.Box2').show(); $('.Box1').hide(); } }); //validate fd.field('rbChoice').$on('change', function(value){ //clear validatior fd.validators.length = 0; //require field if Item 1 selected if(value == 'Choice 1') { fd.validators.push({ name: 'SingleLineText1', error: "ERROR: This field is required.", validate: function() { if(!fd.field('Choice 1').value){ return false; } return true; } }); } //require field if Item 2 selected if(value == 'Choice 2') { fd.validators.push({ name: 'SingleLineText2', error: "ERROR: This field is required.", validate: function() { if(!fd.field('Choice 2').value){ return false; } return true; } }); } }); });