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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

Suggested Solutions

Title # Comments Views Activity
object oriented design (python) and documentation tools 2 72
VB.net and sql server 4 45
youtube blocking politics 4 59
VB script to continue despite error 2 16
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

830 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