I have a set of checkboxes with long values for the form filler and separate short values for the person managing the input. I have a second field that I want to conditionally set to 1 if the form filler checks any of a subset of the checkboxes. So, "if the user selected checkbox 1 or checkbox 3 or checkbox 4 then set the value of field xyz to 1" is what I want to put into the calculation of text field xyz. But how do I use the string values from the checkbox set in the calculation. All the examples I've seen are using numeric values and when I try string values in those comparisions (like below) I get nothing.
What I've tried:
(format from FF docs): (([1215] == 'Alpha' || [1215] == 'Charlie') || [1215] == 'Delta') ? (1) : (0)
(format from a random blog post): if ( [1215] == 'Alpha' || [1215] == 'Alpha' || [1215] == 'Delta' ) { '1' }
You don't say where you've placed the code, so I'm assuming it's a default value calculation for field 2. Default value calculations can be either "text" or "math" based. Text based calculations are used for concatenating strings. Math based calculations are used to produce computational results. Determining a string value with conditional PHP code needs to be done in a custom shortcode you create or custom jQuery.
Please login or Register to submit your answer
In the example above is "Alpha" the long value or the short value (presuming short is the separate value)?
I am having the same issue. Has anyone found a solution?
I have checkboxes with string values and I want another field to show Yes if a certain checkbox value is selected.