Highlighted

Counting checkbox export value

New Here ,
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 

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

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;

TOPICS
PDF forms

Views

133

Likes

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

Counting checkbox export value

New Here ,
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 

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

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;

TOPICS
PDF forms

Views

134

Likes

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
Nov 05, 2020 0
Most Valuable Participant ,
Nov 06, 2020

Copy link to clipboard

Copied

What are the names of the fields?

Likes

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
Reply
Loading...
Nov 06, 2020 0
New Here ,
Nov 06, 2020

Copy link to clipboard

Copied

Check Box1
Check Box2
Check Box3
Till
Check Box15

Likes

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
Reply
Loading...
Nov 06, 2020 0
Adobe Community Professional ,
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...

Likes

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
Reply
Loading...
Nov 06, 2020 0
New Here ,
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 

Likes

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
Reply
Loading...
Nov 07, 2020 0
Most Valuable Participant ,
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;

Likes

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
Reply
Loading...
Nov 07, 2020 1
New Here ,
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 

Likes

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
Reply
Loading...
Nov 07, 2020 0
Adobe Community Professional ,
Nov 07, 2020

Copy link to clipboard

Copied

"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)

Likes

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
Reply
Loading...
Nov 07, 2020 0