Solved

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

Posted on 2014-11-04
1
87 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
ID: 40428738
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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
printing double sided for a pdf document 19 184
Barcode detail gets lost in PDF 3 125
Adobe PDF link to folder 5 59
PDF File Shrinker 10 133
The ability to edit PDF documents can be useful, however it may not be a straight forward process. Many non-technical people don't realise that a PDF document is basically an image rather than a text file, even if it contains nothing but text. If…
Update 21-May-2015: I temporarily removed the source code to make major changes to the program. Regards, Joe In a previous Experts Exchange article, How To Rename-Move a Batch of PDF Files Based on Contents of the Files (http://www.experts-exchan…
In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
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…

831 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