Skip to main content
Participant
April 10, 2019
Question

How can I create a drop down menu that has options dependent on a previous drop down menu answer?

  • April 10, 2019
  • 2 replies
  • 446 views

I am working to update a form that has open-ended fields, but the ability to write anything is causing a problem with tracking. Is it possible to have Drop Down Menu 2 only display certain answers based on the selection of Drop Down Menu 1? I will also need to add a 3rd and 4th level to this so scaling would be ideal.

This topic has been closed for replies.

2 replies

Thom Parker
Community Expert
Community Expert
April 10, 2019

See this article and example, it covers that exact topic:

https://acrobatusers.com/tutorials/js_list_combo_livecycle

You'll also find more info and examples on lists here:

https://www.pdfscripting.com/public/List-Field-Usage-and-Handling.cfm

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Revin86Author
Participant
April 16, 2019

I believe that I understand the coding part, but Where do I save the code? I do not have access to LiveCycle.

Thom Parker
Community Expert
Community Expert
April 16, 2019

The article covers the dropdown technique using two different PDF forms technologies. Ignore the LiveCycle part. LiveCycle Designer used to be part of the Acrobat install, but not anymore. Stick to the example and discussion that shows how to do it in a regular Acrobat PDF Form.

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
try67
Community Expert
Community Expert
April 10, 2019

Yes, this is possible to achieve, using a script. I call it "cascading". You would basically need to use a data model (which can be in a text file that you attach to the PDF or just hard-coded into your script) that contains all possible combinations. Then you check the current fields' values each time one of them is changed and look it up in your data model, and apply all the relevant items that correspond to it to all the fields further "below" it. It's quite tricky to implement, though.

If you're interested, I've developed a (paid-for) tool that allows you to set it up easily and quickly. You just need to have a spreadsheet with all the data, and it does the rest for you. You can find it here: Custom-made Adobe Scripts: Acrobat -- Create Cascading Dropdowns