Adding scripts?

New Here ,
Aug 18, 2019

Copy link to clipboard

Copied

I'm trying to figure out how to have one drop down menu's options affected by another drop down menu's options.

So for example Box A drop down has options 1, 2, 3, 4

If I choose option 1 I want box B drop down to have options Red and blue, but if I choose option 2 I want the box B drop down to have Green and yellow.


I cannot remember what options to choose if anything, and need help figuring out what properties I need to change, or how to edit the script.

TOPICS
Acrobat SDK and JavaScript

Views

49

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

Adding scripts?

New Here ,
Aug 18, 2019

Copy link to clipboard

Copied

I'm trying to figure out how to have one drop down menu's options affected by another drop down menu's options.

So for example Box A drop down has options 1, 2, 3, 4

If I choose option 1 I want box B drop down to have options Red and blue, but if I choose option 2 I want the box B drop down to have Green and yellow.


I cannot remember what options to choose if anything, and need help figuring out what properties I need to change, or how to edit the script.

TOPICS
Acrobat SDK and JavaScript

Views

50

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
Aug 18, 2019 0
Adobe Community Professional ,
Aug 18, 2019

Copy link to clipboard

Copied

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
Reply
Loading...
Aug 18, 2019 0
try67 LATEST
Most Valuable Participant ,
Aug 19, 2019

Copy link to clipboard

Copied

The basic code is quite simple. Use this as the custom validation script of the first drop-down field:

if (event.value=="1") this.getField("B").setItems(["Red", "Blue"]);

else if (event.value=="2") this.getField("B").setItems(["Green", "Yellow"]);

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
Reply
Loading...
Aug 19, 2019 0