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
317 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

947 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

22 Experts available now in Live!

Get 1:1 Help Now