Copy link to clipboard
Copied
I have 7 check boxes with different results. I now want to make a text field that brings those results from the checked off boxes to a new text field. How do I do it?
Example:
say the check boxes are "1", "2", "3", etc.
then in my text field I need to make an If statement, if box 1 and 3 and 5 are checked, then it prints 1, 3, 5
if just 1 is checked, then just "1" will print
Does that make sense?
FIRST TIME USER !!
Copy link to clipboard
Copied
You can use this code as the custom calculation script of your text field:
var fields = ["1", "2", "3", "4", "5"];
var values = [];
for (var i in fields) {
var f = this.getField(fields);
if (f.value!="Off") {
values.push(fields);
}
}
event.value = values.join(", ");
Copy link to clipboard
Copied
okay i think i have this setup incorrectly -- my check box is 1 and next to it currently i have a text - say Blue - but that has to be a formatted field, correct? - and then i want another field to print BLUE if check box 1 is checked - - or is there away of labeling the CheckBox 1 - to print BLUE if checked?
i don't even know what i'm asking anymore ! : )
EX:
checkbox1 Obesity
checkbox2 Clots
so on another page if checkbox1 is checked, it will automatically print "Obesity"
Copy link to clipboard
Copied
You need to set the Export Value for the check box to the text you want displayed. Then the script should work. If you cannot set the export value then you need to add more code to properly fill the array with the text value you want displayed.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now