Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


Check box of group enables second check box issue

Explorer ,
Jun 24, 2021 Jun 24, 2021

Copy link to clipboard

Copied

I've created one group of checkboxes (Type of Parking) and a second checkbox (Car Pool) Car Pool is only enabled when "Regular Access" from Type of Parking is checked. When anything else in the Type of Parking Group is checked or nothing is checked Car Pool should be blank and read-only.

 

I've applied the following script to each checkbox in the Type of Parking group:

if (event.target.valueAsString == "Regular Access") {

this.getField("Car Pool").readonly = false;

} else {

this.getField("Car Pool").readonly = true;

}

and the following script to the Car Pool checkbox

this.getField("Car Pool").readonly = true;
this.resetForm(["Car Pool"]);

It seems to work as far as making Car Pool Read Only or not but I am unable to actually check the Car Pool checkbox when it's enabled. Can anyone help me out here, please?

Here is the link to my sample:

https://drive.google.com/file/d/1BxMhMx7Mr9jEkcDKDa2opbsVFJm3xClO/view?usp=sharing

TOPICS
JavaScript, PDF forms

Views

175

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Engaged , Jun 25, 2021 Jun 25, 2021
Hi, Here is the script for each checkbox of the Type of Parking group:if (event.target.value == "Regular Access") this.getField("Car Pool").readonly = false; else { this.getField("Car Pool").value = "Off"; this.getField("Car Pool").readonly = true; }And remove the one of the Car Pool checkbox! @+

Likes

Translate

Translate
Engaged ,
Jun 25, 2021 Jun 25, 2021

Copy link to clipboard

Copied

Hi,
Here is the script for each checkbox of the Type of Parking group:

if (event.target.value == "Regular Access") this.getField("Car Pool").readonly = false;
else {
	this.getField("Car Pool").value = "Off";
	this.getField("Car Pool").readonly = true;
}

And remove the one of the Car Pool checkbox!
@+

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 25, 2021 Jun 25, 2021

Copy link to clipboard

Copied

LATEST

Thank you very much! I deleted my Car Pool Checkbox and remade it then it worked perfectly with this script.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines