Skip to main content
Participant
July 3, 2023
Question

How to Auto Populate Text Field based on the item selected from Drop down list

  • July 3, 2023
  • 1 reply
  • 498 views

I'm new to using JavaScript in Adobe. I have developed a drop down with a list of Therapy Providers (dropdown property name: "Therapy Provider"). When a specific provider from the list is selected I would like the clinics billing address to population in the Text box ("Text3").  How would I write the JavaScript for the following example: 

Therapy Provider Selected from dropdown: "ABC Therapy Clinic"

Address to have auto polulated in when the above clinic is selected: "1234 Alphabet St.; Townsville, NY 55555"

 

THANK YOU SO MUCH!

This topic has been closed for replies.

1 reply

Thom Parker
Community Expert
Community Expert
July 3, 2023

Here's an article on the topic

https://acrobatusers.com/tutorials/change_another_field/

 

The article outlines a general methodology for setting data based on a dropdown selection. But a very simple brute force method is to use a validation script on the dropdown like this:

 

if(event.value == "ABC Therapy Clinic")
   this.getField("Text3").value = "1234 Alphebet St.; Townsville, NY 55555";
else if(event.value == "Another Therapy Clinic")
   this.getField("Text3").value = "Somewhere else; Townsville, NY 55555";

etc...

 

 

 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often