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?
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)
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"]);
}