I know that there is a bug that forms doesn't always ignore data when it is hidden. I'm thinking of a work around to null or zero out a field after it becomes hidden using JS. I have checkbox field ID 30, and if the user unchecks a box labelled "Airfare", field ID 78 is hidden. However, I'd like to null or zero out field 78. Does anybody have some code to do this?
Question
Question
Replies
replied on June 6
•
Show version history
There is a bug that does not ignore the data?
Set the value of the input or select to nothing using empty quotes, then hide the entire field which includes the label by using the class directly
//single line, number, date $('.myClass input').val(""); //drop down $('.myClass select').val(""); $('.myClass').hide();
0
0
replied on June 6
As far as the bug goes, I was referencing some other posts that I read. Maybe I misread.
I'll give your code a shot but mine is completely different. Although, I tried something different than a checkbox. I'm trying to set the value of fieldId 78 based on the value in fieldId 39.
LFForm.onFieldChange(function() {
console.log("Value from Airfare field: " + LFForm.getFieldValues({fieldId:39}));
if (LFForm.getFieldValues({fieldId:39}) === "FALSE"){
LFForm.setFieldValues({fieldId:78}, {value:""});
}
}, {fieldId:39});
0
0
You are not allowed to follow up in this post.