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

Drop Down Field Coding

Guest
Nov 18, 2016 Nov 18, 2016

I'm using Acrobat Pro and I am editing a pdf form that I have already made.  I have a drop down field with four different options (let's say 1-4). I then have a second drop down field next to it.

What I need to do is make the list of options in the second field dependent on a selection in the first drop down. (i.e. first drop down field selections are 1-4, and the Second drop down field selections are a-d, but if 3 is selected in the first drop down I want the second field options to be a-e.  Hopefully that makes sense. 

Thank you!

TOPICS
PDF forms
574
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
1 ACCEPTED SOLUTION
Community Expert ,
Nov 18, 2016 Nov 18, 2016

[I moved your question to the PDF Forms forum. The Lounge is not for technical questions.]

Yes, this can be achieved using a script. The basic format of that script would be (as the custom validation script of the first field):

if (event.value=="1") this.getField("Dropdown2").setItems(["a", "b", "c", "d"]);

else if (event.value=="2") this.getField("Dropdown2").setItems(["a", "b", "c", "d", "e"]); // etc.

else this.getField("Dropdown2").clearItems();

If you're interested in a tool that will allow you to set up such dependent drop-down fields easily, and without having to write any code, check out this one I've developed: Custom-made Adobe Scripts: Acrobat -- Create Dependent Dropdowns

View solution in original post

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 ,
Nov 18, 2016 Nov 18, 2016

[I moved your question to the PDF Forms forum. The Lounge is not for technical questions.]

Yes, this can be achieved using a script. The basic format of that script would be (as the custom validation script of the first field):

if (event.value=="1") this.getField("Dropdown2").setItems(["a", "b", "c", "d"]);

else if (event.value=="2") this.getField("Dropdown2").setItems(["a", "b", "c", "d", "e"]); // etc.

else this.getField("Dropdown2").clearItems();

If you're interested in a tool that will allow you to set up such dependent drop-down fields easily, and without having to write any code, check out this one I've developed: Custom-made Adobe Scripts: Acrobat -- Create Dependent Dropdowns

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
Guest
Nov 18, 2016 Nov 18, 2016
LATEST

Ended up using your suggestion from another thread. Ended up with this coding that seems to work fairly well.

Thank you try67

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