I have a form with a three hidden fields that show TRUE or FALSE depending on whether a particular type of submission is possible.
The hidden fields look at three different tables populated by lookup rules. If the table has rows the hidden field shows true for that list. The hidden fields use an Advanced Formula to see if there are one or more rows in each of the three tables. This works great with my field rules. HTML fields with the "you can't do this' message show or hide like they're supposed to.
To make the form as foolproof as possible I want to use LFForms.changeFieldOptions to remove options from a radio button if the hidden field for that option says 'FALSE'.
But it seems to get stuck on FALSE and always removes the option. I think the error is something to do with the onFieldChange, but I'm stumped.
LFForm.onFieldChange(() => optionPendingShow() , {variableName: "HAS_PENDING_TRANSACTIONS"});
function optionPendingShow() {
let newTF = LFForm.getFieldValues({fieldId: 155});
if (newTF = "FALSE") {
LFForm.changeFieldOptions( { fieldId: 125 }, ["Submit transaction receipt and coding"], "remove" );
}
}