Copy link to clipboard
Copied
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.
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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....
Copy link to clipboard
Copied
🙂 You're welcome!