Answered
Here's the calculation code for the total field for "On":
var total = 0;
for (var i=1; i<=31; i++) {
var fname = "Drop down#"+i;
var f = this.getField(fname);
if (f==null) {
console.println("Error! Can't locate the field: " + fname);
continue;
}
if (f.valueAsString=="On") total++;
}
event.value = total;
You can easily adjust it for the others. Just change the value in quotes in this line:
if (f.valueAsString=="On")
Make sure you fix the errors you have in the other calculation scripts, though!
Also, I would recommend setting the option for all the drop-downs to commit their selected values immediately (under Properties, Options). Otherwise, the calculation will only update once the user exits the drop-down field, instead of when they make a selection in it.
Sign up
Already have an account? Login
To post, reply, or follow discussions, please sign in with your Adobe ID.
Sign inSign in to Adobe Community
To post, reply, or follow discussions, please sign in with your Adobe ID.
Sign inEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.
