Copy link to clipboard
Copied
I have a list of items labeled Check Box 1 to Check Box 30. I need to calculate how many actually get checked. I am so new to this so step by step would be helpful.
Thanks!
Copy link to clipboard
Copied
You can use this code as the custom calculation script of the field where you want to display the result:
var total = 0;
for (var i=1; i<=30; i++) {
var fname = "Check Box "+i;
var f = this.getField(fname);
if (f==null) {app.alert("Error! Can't find: " +fname); continue;}
else if (f.valueAsString!="Off") total++;
}
event.value = total;