Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

multiple dependency of list-boxes in AcroForm

Explorer ,
Feb 14, 2018 Feb 14, 2018

I am building an Acrobat pdf form (via DC pro) in which I would like to populate the lists dynamically according to user selection.

To explain, I will examplify

I have 5 form fields defined as list-boxes: continent, country, region, city, town

I want user to select them respectively, and show only the relevant content in the next list-box.

So, if a user selects Europe as a continent, she/he will be able to see for instance France, UK, Spain, etc; but not USA.

And, if the user continues on for instance by France, then she/he will be able to see Marseille, Nantes, Paris, etc. in the next box...

And so on...

I could link the first two boxes thanks to detailed guideline by Thom Parker: https://acrobatusers.com/tutorials/js_list_combo_livecycle​

BUT, how I proceed if I have MULTIPLE dependency?

I would appreciate to hear any experience/advice.

TOPICS
PDF forms
1.2K
Translate
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
Community Expert ,
Feb 14, 2018 Feb 14, 2018

The trick is to extend the scheme outlined in the article to the next level of fields.  An easy way to this is to simply create duplicates of all the objects and functions, renamed of course, that you used already, and apply these to the next drop down.

As you do this there are some issues that will become apparent. For example, a list change in one dropdown, will mean the following dropdowns will need to be cleared. There are a number of these management issues that become increasing complex as you add more levels of dropdowns. Another one is maintaining the current state of the fields when the form is saved and restarted.

You're getting into advanced scripting territory here, so it's going to take some focus and effort to get it right.  I've created scripts and examples that extend this scheme on this subscription site:

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

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Translate
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 ,
Feb 15, 2018 Feb 15, 2018
LATEST

Thank you.

Translate
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