Skip to main content
Participant
December 12, 2016
Answered

Count evaluations

  • December 12, 2016
  • 1 reply
  • 355 views

I have an acrobat form with 10 questions that people can evaluate using one of 4 radios (0-1-2-3). I want to count how many of the questions score 2 or greater and put that in the 'TOTAL'.

ie.

1. 1

2. 2

3. 0

4. 3

5. 3

6. 3

7. 2

8. 1

9. 2

10. 3

TOTAL = 7

This topic has been closed for replies.
Correct answer try67

Let's say the fields are called Q1, Q2, ..., Q10. You can use this code as the custom calculation script of the Total field:

var total = 0;

for (var i=1; i<=10; i++) {

    if (Number(this.getField("Q"+i).valueAsString)>=2) total++;

}

event.value = total;

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
December 13, 2016

Let's say the fields are called Q1, Q2, ..., Q10. You can use this code as the custom calculation script of the Total field:

var total = 0;

for (var i=1; i<=10; i++) {

    if (Number(this.getField("Q"+i).valueAsString)>=2) total++;

}

event.value = total;