Skip to main content
New Participant
April 4, 2023
Answered

Auto Populate Text When Drop Down Selection Is Made

  • April 4, 2023
  • 2 replies
  • 7868 views

Hello,

Every formula I have found seems to not be working for this issue. I am trying to auto populate text when a selection is made on a drop down list in Adobe Acrobat Pro. 

Drop down box is labeled "Application" and text field is "Application Owner" when a selection is made under "Application" I want the owner of each application to auto fill in the text field "Application Owner" I have 6 applications to chose from and 5 owners.

 

I'm not sure if this would work better if both boxes were drop downs?

 

Please help!!!

 

Thank you!

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

As validate script of dropdown field use this:

var f = this.getField("Application Owner");
if(event.value == "Selection for owner1")
f.value = "Info for owner1";
else if(event.value == "Selection for owner2")
f.value = "Info for owner2";
else if(event.value == "Selection for owner3")
f.value = "Info for owner3";

//add more 'else if' lines here for other choices as needed

else
f.value = "";

Change "Selection for owner" to your actual choices in dropdown and "Info for owner" with info for that owner you would like to show in "Application Owner".

2 replies

New Participant
February 29, 2024

I have watched your video, which was very helpful, but I'm still unable to have the information autopopulate into my document.  I'm new to javascript,  and might be missing something.  I'm trying to have the Contract Name autopopulate when the Contract No is selected.

Nesa Nurani
Community Expert
Community Expert
March 1, 2024

Where did you put the script?  Can you share your file?

New Participant
March 7, 2024

 


This may be a rookie questions, but should the custom calculation script be associated witht he ContractName field or the drop down field?

Nesa Nurani
Community Expert
Nesa NuraniCommunity ExpertCorrect answer
Community Expert
April 4, 2023

As validate script of dropdown field use this:

var f = this.getField("Application Owner");
if(event.value == "Selection for owner1")
f.value = "Info for owner1";
else if(event.value == "Selection for owner2")
f.value = "Info for owner2";
else if(event.value == "Selection for owner3")
f.value = "Info for owner3";

//add more 'else if' lines here for other choices as needed

else
f.value = "";

Change "Selection for owner" to your actual choices in dropdown and "Info for owner" with info for that owner you would like to show in "Application Owner".

New Participant
April 4, 2023

Thank you! I'm not sure if I have an error in here but this is the formula I entered (removed names for post) and my text field isn't auto populating with the name..

"Application Owner" is the name of the text box where I want "Owner Name" to appear. I enterned the JavaScript in the drop down properties. Drop down name is "Application".

 

var f = this.getField("Application Owner");
if(event.value == "Application Name")
f.value = "Owner Name";
else if(event.value == "Application Name")
f.value = "Owner Name";
else if(event.value == "Application Name")
f.value = "Owner Name";
else if(event.value == "Application Name")
f.value = "Owner Name"
else if(event.value == "Application Name")
f.value = "Owner Name"
else if(event.value == "Application Name")
f.value = "Owner Name"

Nesa Nurani
Community Expert
Community Expert
April 4, 2023

It looks ok, did you set export values in dropdown field?