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

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

123

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
Community Expert ,
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.";

Votes

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
Community Expert ,
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

Votes

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