Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Counting checkbox export value

New Here ,
Nov 05, 2020 Nov 05, 2020

Hi, 

I have a form with 15 questions, for each question, there are 3 answers (A, B, and C). at the end of the form, there is a table for the results (A, B, and C).

I need to count the number of selections for each one (example: A: 7, B: 3, C: 5). I set the export value for A answers as "A" and so on.. 

I tried to search for a solution but couldn't find anything.

 

Your help is greatly appreciated.

 

Thanks 

TOPICS
PDF forms
1.5K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 ACCEPTED SOLUTION
Community Expert ,
Nov 07, 2020 Nov 07, 2020

You can use this code to count the number of instances "A" was selected, and with minor adjustments the rest of them:

 

var total = 0;

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

if (this.getField("Check Box"+i).valueAsString=="A") total++;

}

event.value = total;

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 06, 2020 Nov 06, 2020

What are the names of the fields?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 06, 2020 Nov 06, 2020

Check Box1
Check Box2
Check Box3
Till
Check Box15

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 06, 2020 Nov 06, 2020

I think this was just answerd but using radio buttons in this thread: https://community.adobe.com/t5/acrobat/calculation-to-score-a-quiz-with-radio-buttons/m-p/11573478#M...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 07, 2020 Nov 07, 2020

That's a different scenario, in your reply, the final calculation is the result of all selections as one sum.

In my case, I need to know how many A, B, and C. Therefore, there are 3 calculators, one to count A, one to count B and one to count C

 

Refer to this example https://www.dropbox.com/s/jv3axw68zkwgr7p/Example.pdf?dl=0 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 07, 2020 Nov 07, 2020

You can use this code to count the number of instances "A" was selected, and with minor adjustments the rest of them:

 

var total = 0;

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

if (this.getField("Check Box"+i).valueAsString=="A") total++;

}

event.value = total;

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 07, 2020 Nov 07, 2020

Thanks,

It's working.  -:)

Unfortunately, it looks that the built-in PDF viewers on Edge and Chrome don't support that sort of thing...

https://www.dropbox.com/s/jv3axw68zkwgr7p/Example.pdf?dl=0 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 07, 2020 Nov 07, 2020
LATEST

"Unfortunately, it looks that the built-in PDF viewers on Edge and Chrome don't support that sort of thing..."

All PDF form makers should know this great trick:
https://www.abracadabrapdf.net/ressources-et-tutos/creation/forcer-utilisation-pdf-avec-acrobat-read...
(Google translate is your friend)


Acrobate du PDF, InDesigner et Photoshopographe
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines