Solved

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

Posted on 2014-11-04
1
90 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
*Adobe Acrobat 9 was used for this article. Particular steps may vary depending on software versions. 1. Create a framework of your form in Word, leaving space where you’d ultimately like the Adobe fields to appear.  (Note: I use the blank lines …
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 a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

680 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