Skip to main content
Participating Frequently
August 2, 2022
Question

Checking "Box 1" checks boxes "2", "3", etc and runs associated scripts

  • August 2, 2022
  • 2 replies
  • 1092 views

Hey there folks, to start off I'm brand new to Adobe Acrobat and all things JavaScript. Working on a project right now where I'm attempting to use JavaScripts to streamline the overall form. The area in question right now is a checkbox for showing additional fields to enter data. I've set it up do checking the inital box labeled "BC" will check to additional boxes "SerialID Row" and "RowExt". The script is set up as follows currently.

this.getField("SerialID Row").value = event.target.value;

this.getField("SerialID Row").readonly = (event.target.value == "Yes");

this.getField("RowExt").value = event.target.value;

this.getField("RowExt").readonly = (event.target.value == "Yes");

The issue is while this does check and uncheck "SerialID Row" and "RowExt" it dosen't run those checkboxes' respective scripts. Those scripts are set up as follows. With the only difference being in the names for getField.

var checkbox = this.getField("SerialID Row")
var dropdowns = []
var num = 76

for (i = 1; i <= num; i++)
dropdowns[i] = this.getField("SerialID Row" + i)

if (checkbox.value == "Off") {
for (i = 1; i <= num; i++)
dropdowns[i].readonly = true
} else {
for (i = 1; i <= num; i++)
dropdowns[i].readonly = false
}

I'm not sure where to go from here and don't know enough to try and interpert similar solutions to this issue. Any help or direction would be appreciated. As an FYI this is being done on Adobe Acrobat X Pro version 10.1.16 in case that matters. Thanks again in advance.

This topic has been closed for replies.

2 replies

Participant
August 5, 2022
mg3733479@gmail.com
Bernd Alheit
Community Expert
Community Expert
August 2, 2022

Where does you use the script?

Participating Frequently
August 2, 2022

All three are in a checkbox under the action tab with a Mouse Up Trigger.

Bernd Alheit
Community Expert
Community Expert
August 2, 2022

Use the mouse and the script will run.