Copy link to clipboard
Copied
I have 43 dropdowns with the option of Yes or No. Need to count all the yes selections.
Named: Dropdown1-Dropdown43
What would be the script? Thanks in advance!
You can use this code as the custom calculation script of the text field that should show the total number of "Yes" options selected:
var total = 0;
for (var i=1; i<=43; i++) {
var f = this.getField("Dropdown"+i);
if (f.valueAsString=="Yes") total++;
}
event.value = total;
Copy link to clipboard
Copied
You can use this code as the custom calculation script of the text field that should show the total number of "Yes" options selected:
var total = 0;
for (var i=1; i<=43; i++) {
var f = this.getField("Dropdown"+i);
if (f.valueAsString=="Yes") total++;
}
event.value = total;
Copy link to clipboard
Copied
That worked! Thank you very much!!!!
Copy link to clipboard
Copied
I have one more question, please. Now that I have the value of how many yes selections in my text3 box how can I calculate that into a percentage into a text4 box?
Copy link to clipboard
Copied
Divide that value by 43.
Copy link to clipboard
Copied
Yes, but what would be the script be in text4 to calculate what was in text3 by 43?
Copy link to clipboard
Copied
Under the Simplified Field Notation option enter:
text3 / 43