Populate a PDF form field based on drop-down selection

I created a PDF form using Acrobat 8 Pro.
I have a drop down field called 'Location' and I have pre-populated it with 8 location names.
I have a text box field called 'Address' and it is blank.

When the user selects one of the locations from the 'Location' drop-down list, I want the field called 'Address' to automatically populate with that location's address.

How do I do this?
LVL 11
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Karl Heinz KremerCommented:
I assume you know how to add JavaScript to a form field. For the following to work, you need to create a custom validation script for your list box ("Location"). Just replace the "ValueX" strings with the actual strings from your list box, and the "txtX" strings with your address strings.
var v = event.value;
var targetValue = "";
if (v == "Value1")
    targetValue = "txt1";
else if (v == "Value2")
    targetValue = "txt2";
else if (v == "Value3")
    targetValue = "txt3";
else if (v == "Value4")
    targetValue = "txt4";
this.getField("Address").value = targetValue;

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ecarboneAuthor Commented:
Exactly what I was looking for ... thank you!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Acrobat

From novice to tech pro — start learning today.