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

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

New Here ,
Jul 03, 2023 Jul 03, 2023

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!

TOPICS
How to , JavaScript
433
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 ,
Jul 03, 2023 Jul 03, 2023
LATEST

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 PDFScripting
Use the Acrobat JavaScript Reference early and often

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