Solved

In Acrobat:  How do I make a group of radio buttons only appear when a certain checkbox is checked?

Posted on 2015-02-23
1
316 Views
Last Modified: 2015-03-03
Hi fellas,

I've got an Adobe form I'm working on.  It is intended to document changes to system access (permission changes in AD, access to various financial applications, etc.).  It presents a list of systems available, and next to each one are three radio buttons named Add, Change, or Remove.  I want these radio buttons to be grayed out or invisible or otherwise inaccessible unless a checkbox next to the system name is checked.  

So in short:  When checkbox is checked, radio buttons can be selected.  When unchecked, they are inaccessible.

I figure this will involve some VBScript or JavaScript, but I have no idea (1)what the code will be and (2)how to inject the code into the PDF.
0
Comment
Question by:imtt321
1 Comment
 
LVL 44

Accepted Solution

by:
Karl Heinz Kremer earned 500 total points
ID: 40635635
There is no VBScript in Acrobat, all customization is done via JavaScript. Let's assume you have a radio button group named "Group.1" with the three options Add, Change and Remove, and a checkbox named "CheckBox.1" . Open up the field properties for your checkbox and go to the "Action" tab, then add a "Mouse Up" action of "Run a JavaScript" and use the following script:

var res = event.target.name.split('.');
var idx = 0;
if (res.length > 1) {
    idx = res[1];
}

if (event.target.value == "Off") {
    this.getField("Group." + idx).readonly = true;
}
else {
    this.getField("Group." + idx).readonly = false;
}

Open in new window


You can use the same script for each of your checkbox/group combinations, as long as they all share the same numeric extension (e.g. .1 .2 and .3).
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
A short article about problems I had with the new location API and permissions in Marshmallow
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
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…

746 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

10 Experts available now in Live!

Get 1:1 Help Now