How can you make Conditional Drop Downs in a PDF Form?

May 16, 2017

Copy link to clipboard

Copied

Could someone please explain to me how to make a conditional drop down on a PDF form?  For example if I have more than one categories like Fruit, Vegetables and then I would like the subsequent field to only show the options that fall within the previous fields options like Apple, Banana, Pear, Pineapple if you choose Fruit and Celery, Carrot, Beet, Pea if you choose Vegetable.  Is this possible?

TOPICS
Acrobat SDK and JavaScript, Windows

Views

1.2K

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

How can you make Conditional Drop Downs in a PDF Form?

May 16, 2017

Copy link to clipboard

Copied

Could someone please explain to me how to make a conditional drop down on a PDF form?  For example if I have more than one categories like Fruit, Vegetables and then I would like the subsequent field to only show the options that fall within the previous fields options like Apple, Banana, Pear, Pineapple if you choose Fruit and Celery, Carrot, Beet, Pea if you choose Vegetable.  Is this possible?

TOPICS
Acrobat SDK and JavaScript, Windows

Views

1.2K

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
May 16, 2017 0
Most Valuable Participant ,
May 16, 2017

Copy link to clipboard

Copied

Yes, it is. You would basically use the validation (or keystroke) event of the "parent" dropdown to populate the values of the "child" ones, using the setItems method.

I've developed several tools that allow you to set up such behavior:

Custom-made Adobe Scripts: Acrobat -- Populate Fields From Dropdown (populate non-dropdown fields with values based on a selection in a dropdown)

Custom-made Adobe Scripts: Acrobat -- Create Dependent Dropdowns  (populate a "dependent" dropdown field based on the selection in the "master" dropdown, pretty much what you described above)

Custom-made Adobe Scripts: Acrobat -- Create Cascading Dropdowns (create a set of "cascading" dropdowns, each one populating the next one based on their selection, with the data coming from a spreadsheet)

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...
May 16, 2017 0
XML1979 LATEST
Explorer ,
Jun 10, 2020

Copy link to clipboard

Copied

I use something like this as a validation script under the dropdown that has the Fruit, Vegetables, etc. options that will populate the option list in another dropdown,  I call it Specifics below:

 

switch (event.value) {
case "Fruit":
this.getField("Specific").setItems(["Apple","Bannana","Pear"]);
case "Vegetable":
this.getField("Specific").setItems(["Celery","Carrrot","Beet"]);

}

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...
Jun 10, 2020 1