Skip to main content
Known Participant
June 4, 2020
Question

Score calculation in pdf form having check boxes

  • June 4, 2020
  • 2 replies
  • 3302 views

Hello, I have created a score form having check boxes. I can easily calculate total score by assigning values 1 2 3 to check boxes and by giving same names in same row to the check boxes. 

 

But how is this possible to calculate sub total score of each column separately. See picture

 

This topic has been closed for replies.

2 replies

Thom Parker
Community Expert
Community Expert
June 7, 2020

These look like Radio button groups. If this is true, then a script won't be able to identify the individual column fields by name. Instead you'll the script will need to count selected values.

 For example, lets say the radio button groups are named "Score1" thorough "Score10". The calculation script for the 0 column total would be this:

 

var nSum = 0, oFld;

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

{

    oFld = this.getField("Score" + i);

     if(oFld.value == 0)  nSum++;

}

event.value = nSum;

      

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Participant
May 25, 2023

Hi Tom. I am creating some self-assessments in Adobe. I used Radio Buttons for the Selections. Do you know how I would be able to summarize the score by adding all choice 1's together, sum Choice 2's together, etc......?

 

Nesa Nurani
Community Expert
Community Expert
May 25, 2023

What are the names of radio button groups?

Do you want to show all results in one field?

JR Boulay
Community Expert
Community Expert
June 4, 2020

You should structure the naming rule by column, as in this example that you should examine: https://documentcloud.adobe.com/link/track?uri=urn:aaid:scds:US:1c732995-09a8-4dc3-ab3b-661aa1d3f1ab

Acrobate du PDF, InDesigner et Photoshopographe