Skip to main content
Participant
September 11, 2018
Answered

How do I make a dropdown field auto populate two other fields?

  • September 11, 2018
  • 1 reply
  • 942 views

I've been trying for 3 days to make it where when I chose an address in a dropdown, and have it auto populate the phone and fax number to no avail. I'm using Adobe Acrobat Pro DC. Any help would be appreciated. Thank you.

This topic has been closed for replies.
Correct answer try67

Remove the line numbers from the code. They should not have been a part of it if you copied it from the website.

1 reply

try67
Community Expert
Community Expert
September 11, 2018

You can use something like this as the custom validation script of the drop-down field:

if (event.value=="Main Street 1") {

    this.getField("PhoneNumber").value = "555 999 1234";

    this.getField("FaxNumber").value = "555 999 1235";
} else if (event.value=="Maple Street 12") {

    this.getField("PhoneNumber").value = "555 678 1234";

    this.getField("FaxNumber").value = "555 678 1235";

} // etc.

Make sure to tick the option to commit the selected value of the drop-down field immediately (under Properties - Options) for it to update the other fields as soon as a selection is made.

Erik52Author
Participant
September 12, 2018

Thank you for you're reply. I copied and pasted the script you sent me and changed the info to mine but I'm still doing something wrong. I have the addresses in a dropdown box, and the phone and fax numbers in their own text boxes for 3 total boxes. Is this correct? Here is a screen shot of what I'm looking at.

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
September 12, 2018

Remove the line numbers from the code. They should not have been a part of it if you copied it from the website.