Skip to main content
Participant
May 8, 2024
Answered

PRO DC - Help creating 2 dropdowns and 1 text field (auto populate w/ ability to edit)

  • May 8, 2024
  • 1 reply
  • 679 views

I am not very good with Adobe Acrobat Pro DC and need help!  I am trying to create a dropdown connected to another dropdown, which then determines an auto-populated text field.  I also need the auto-populated text field to allow manual text changes/additions.  I have attached an example of what I am needing.  Does anyone have suggestions for the proper scripts for each dropdown and text field?  Thank you!

This topic has been closed for replies.
Correct answer Nesa Nurani

There are already so many answers to these questions on the forum.

As 'Custom Validate' script of "PETS" dropdown, use this:

var type = this.getField("TYPE");
switch(event.value){

case "Dog":
type.setItems(["Lab","Poodle"]);
break;

case "Cat":
type.setItems(["Saimese","Persian"]);
break;

default:
type.clearItems();}

 As 'Custom Validate' script of "TYPE" dropdown, use this:

var trait = this.getField("TRAIT");
switch(event.value){

case "Lab":
trait.value = "Friendly";
break;

case "Poodle":
trait.value = "Smart";
break;

default:
trait.value = "";}

 

1 reply

Nesa Nurani
Community Expert
Nesa NuraniCommunity ExpertCorrect answer
Community Expert
May 8, 2024

There are already so many answers to these questions on the forum.

As 'Custom Validate' script of "PETS" dropdown, use this:

var type = this.getField("TYPE");
switch(event.value){

case "Dog":
type.setItems(["Lab","Poodle"]);
break;

case "Cat":
type.setItems(["Saimese","Persian"]);
break;

default:
type.clearItems();}

 As 'Custom Validate' script of "TYPE" dropdown, use this:

var trait = this.getField("TRAIT");
switch(event.value){

case "Lab":
trait.value = "Friendly";
break;

case "Poodle":
trait.value = "Smart";
break;

default:
trait.value = "";}

 

Participant
May 10, 2024

Thank you so much for your help!   This was my first time using Adobe Community so it was very unfamiliar.  Next time I will do a better job searching for answers to my questions before posting.  Again, thank you for taking the time to help me.  I spent hours trying different scripts prior to your help.