?
Solved

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

Posted on 2014-11-04
1
Medium Priority
?
98 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 44

Accepted Solution

by:
Karl Heinz Kremer earned 2000 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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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

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…
Inserting page numbers in Portable Document Files not only enhances manageability but also makes them look professional. With numbered pages, the file appears more organized and it becomes easier to search for a particular page. The size and the vol…
In this video, we show how to convert an image-only PDF file into a PDF Searchable Image file, that is, a file with both the image (typically from scanning) and text, which is created in an automated fashion with Optical Character Recognition (OCR) …
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…
Suggested Courses

762 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