asked on November 4
•
Show version history
Hi, I have two fields. 1. Yes or No Radio button and 2. Yes or No Checkbox. when I select Yes in the radio button field then I would like to have Yes in the Checkbox selected automatically. However i would like to have this done with a JavaScript. Unless there is an easier way. Anyway, here is my code. Can someone see why this isn't working?
LFForm.onFieldChange(function() {
let radio = LFForm.getFieldValues({ fieldId: 1 });
console.log(radio);
if (radio === "Yes") {
LFForm.setFieldValues({ fieldId: 2 }, { value: "Yes" });
}
}, { fieldId: 1 });
0
0