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

Counting checkbox export value

New Here ,
Nov 05, 2020 Nov 05, 2020

Copy link to clipboard

Copied

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

Views

795

Translate

Translate

Report

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

correct answers 1 Correct answer

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;

Votes

Translate

Translate
Community Expert ,
Nov 06, 2020 Nov 06, 2020

Copy link to clipboard

Copied

What are the names of the fields?

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

Check Box1
Check Box2
Check Box3
Till
Check Box15

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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...

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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 

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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;

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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 

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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)

Votes

Translate

Translate

Report

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