Skip to main content
Participant
July 9, 2025
Question

Autofill

  • July 9, 2025
  • 3 replies
  • 189 views

Hey,

 

im trying to use a drop down option for different names at work. My goal is when I choose a specific name using a drop down that in another field it will automatically populate a number for them. I'm not sure which to use a code to use. 

3 replies

Thom Parker
Community Expert
Community Expert
July 9, 2025
Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
PDF Automation Station
Community Expert
Community Expert
July 9, 2025

1)  Set the numbers as the corresponding export values for each item.

2)  Also, select "Commit selected value immediately" in the options tab of the dropdown field properties.

3)  Enter the following custom calculation in the text field you want to populate:

event.value=this.getField("TheDropdownField").value;

(Change "TheDropdownField" to the actual dropdown field name)

Legend
July 9, 2025

Hi @johnson_5591,

 

 

 

Thanks for reaching out!

 

Yes, you can absolutely set up autofill behavior in your PDF form using JavaScript in field properties—no external scripts needed.

 

For example, if you want other fields (like phone number or department) to fill automatically when an ID or name is entered, you can do this:

 

 

1. Go to Prepare Form > Right-click your source field (e.g., “EmployeeID”) > choose Properties.

2. In the Actions tab, set the trigger to On Blur and the action to Run a JavaScript.

3. Use a script like this:

 

var id = this.getField("EmployeeID").value;

 

if (id === "12345") {

    this.getField("Phone").value = "555-1234";

    this.getField("Department").value = "HR";

}

 

You can customize the logic based on your data. This makes the form dynamic and responsive without any external plugin or manual input in each field.

 

Wait for input from experts and let us know how it works



Best regards,
Tariq | Adobe Community Team