Solved

Adobe Acrobat radio button how to add counter for each checked answer

Posted on 2014-11-04
1
83 Views
Last Modified: 2015-04-17
I have put together an adobe acrobat XI pro file with 60 radio buttons.
I want to have to each button add to a counter that outputs in a text box for each answer.

The I have each set of radio buttons call Guideline with a corresponding number to the question with only 2 answers yes and no


Guideline 1 check = yes ; Counteryes =+ 1 for each yes, display in a text box named Guideline Calculation Yes
Guideline 2 check no ; Counterno =+1 for each no, display in a text box named Guideline Calculation No
0
Comment
Question by:itdeptvnam
1 Comment
 
LVL 44

Accepted Solution

by:
Karl Heinz Kremer earned 500 total points
Comment Utility
Create the two fields Counteryes and Counterno, and make them read-only. Now add a custom calculation script to the Counteryes field and use the following code:

var aRadioButtons = [ "Radio1", "Radio2", "Radio3", "Radio4" ];

// count the number of "Yes" and "No" selections
var numYes = 0;
var numNo = 0;

for (var i in aRadioButtons) {
    var f = this.getField(aRadioButtons[i]);
    if (f != null) {
        if (f.value == "Yes") {
            numYes++;
        }
        else if (f.value == "No") {
            numNo++;
        }
    }
}

// this is the "Counteryes" field
event.value = numYes;
this.getField("Counterno").value = numNo;

Open in new window


You of course have to modify the array with the radio button names to contain your 60 radio button groups that you are using.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

This article focuses on how to remove password security from multiple PDF files by Adobe Acrobat program. Sometimes it is essential to access the stored data items and to print, edit as well as copy content from Portable Document Format files in abs…
The Adobe PDF proprietary file format is recognized as secure and formulated. But these PDF files are also prone to corruption and any external threat like virus attacks, improper storage can hit PDF file integrity.This type of damages can make cruc…
In this third video of the Xpdf series, we discuss and demonstrate the PDFtoText utility, which converts PDF files into plain text files. Download and install the software.: You may have already downloaded and installed the Xpdf tools while watching…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now