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

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

Community Beginner ,
May 07, 2024 May 07, 2024

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!

TOPICS
PDF
645
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 ,
May 07, 2024 May 07, 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 = "";}

 

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 ,
May 07, 2024 May 07, 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 = "";}

 

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 Beginner ,
May 09, 2024 May 09, 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.

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 Beginner ,
May 14, 2024 May 14, 2024
LATEST

If I select "Select" under the "PETS" dropdown list, is there a script to prevent the words "Select" from printing?  I don't want the item "Select" to print, but I want "Dog" and "Cat" to print.

 

Also, is there a script in which I can add 10 years to a date field?  For example, if I select today's date 5/14/2024, it will show on my form as "5/14/2034".

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