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

Autofill

New Here ,
Jul 09, 2025 Jul 09, 2025

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. 

TOPICS
Comment review and collaborate Experiment , How to , JavaScript , PDF
205
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
Adobe Employee ,
Jul 09, 2025 Jul 09, 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

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 09, 2025 Jul 09, 2025

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

PDFAutomationStation_0-1752088445209.png

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)

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 09, 2025 Jul 09, 2025
LATEST

See this article:

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

 

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