These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Using Button to Select a Checkbox

burlesondds
Registered: Jul 12 2008
Posts: 5
Answered

What script allows one to select a checkbox upon clicking a button?

Our clinical assistants need to be able to click on an image and have a checkbox selected in another area of the Acrobat PDF describing the clinical image for our patients.

Thanks so much for your help!
Dr. B

My Product Information:
Acrobat Pro 8.1.2, Macintosh
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
You can use JavaScript to set the value of the check box to whatever you've set as its export value. For example, in the button Mouse Up event, you could use code like the following:

getField("checkbox1").value = "Yes";

where "checkbox1" is the name of the checkbox and "Yes" is the export value.

If you ever need to programmatically uncheck a checkbox, set the field's value to the string "Off", but not "off", OFF, 0, false, or anything else.

George
burlesondds
Registered: Jul 12 2008
Posts: 5
Awesome! Thanks so much. I figured it was pretty easy and found the area in the Acrobat JavaScript users manual, but wanted some expert advice before too many failed attempts.

Thanks again!