Skip to main content
Participant
February 8, 2019
Answered

I created a pdf form and am using radio buttons. I am using adobe Acrobat pro XI.

  • February 8, 2019
  • 1 reply
  • 797 views

I created a PDF form and am using radio buttons. I am using Adobe Acrobat Pro XI. I have been creating fillable forms for about a year now but want to take the extra step. I have 15 different group of radio buttons named "Observation Group 1 to  Observation Group 15" and in each group i have 3 choices " compliant, non-compliant and not applicable". i would like to be able to total each of the 3 choices ( how many compliant, how many Non-compliant etc) in another box. I think I would need a script file for this. I think it goes in the "Calculate" or in the "action" properties but really have no clue how to do it.  I have read a lot of this forum and would love any help you could bring. In my head it doesn't seem very hard when I explain what I want but I might be wrong.

This topic has been closed for replies.
Correct answer try67

No, it's not too difficult. You can use this code as the custom calculation script of the first total field:

var total = 0;

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

    if (this.getField("Observation Group "+i).valueAsString=="compliant") total++;

}

event.value = total;

Adjust the value in line #3 to use it for the other total fields.

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
February 8, 2019

No, it's not too difficult. You can use this code as the custom calculation script of the first total field:

var total = 0;

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

    if (this.getField("Observation Group "+i).valueAsString=="compliant") total++;

}

event.value = total;

Adjust the value in line #3 to use it for the other total fields.

ben001313Author
Participant
February 8, 2019

That was exactly what I was looking for. While reading through this forum I had noticed that "try67" is super helpful and was very happy to see that you had responded to my problem. Thank you very much for the help. I looked through the script and pretty much understood what you had done. Hope to be able to this on my own soon....

try67
Community Expert
Community Expert
February 8, 2019

:-) You're welcome!