Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


Dropdown form field where selection prefills another text field in document

Community Beginner ,
Aug 17, 2021 Aug 17, 2021

Copy link to clipboard

Copied

Can a dropdown item in its list supply a value to another text field in the document?

TOPICS
How to, JavaScript, PDF forms

Views

27

Likes

Translate

Translate

Report

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
Adobe Community Professional ,
Aug 17, 2021 Aug 17, 2021

Copy link to clipboard

Copied

Yes, using a script.

Here's the basic code to do it (to be used as the custom validation script of the drop-down):

 

if (event.value=="Option 1") this.getField("Text1").value = "Some text for option 1.";

else if (event.value=="Option 2") this.getField("Text1").value = "Some text for option 2.";

Likes

Translate

Translate

Report

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
Adobe Community Professional ,
Aug 17, 2021 Aug 17, 2021

Copy link to clipboard

Copied

LATEST

Yes and a very basic script can do it. Dropdowns and list items can have two values, the "Item" which gets displayed to the user in the list and the "Export Value" which is the actual value of the field when that item is selected. If you wanted another field to show Canis lupus familiarise when Dog is selected from the list, just set the Export Value like below then add a custom calculation script to the other field that copies the Export Value of the list box. Like this...

 

event.value = this.getField("listFieldName").value

 

Screen Shot 2021-08-17 at 2.22.38 PM.png

Likes

Translate

Translate

Report

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