These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

automatically populate fields based on dropdown list selection

mattpenner
Registered: Oct 25 2007
Posts: 4

Hi,
I'm new to creating PDF forms, and have not done anything involving Javascript yet, but i think for the the functionality that i want i may have to learn. Could anyone please provide some guidence, i thought this would be much simplier then it is turning out to be.

I would like to have a drop down list with a few names (5 or so), and depending on which name is picked, then the persons mailing address, telephone and email address will all be automatically populated onto the form.
I want all this info to be contained in the PDF form (so no links to any external files).
Any help? I have no idea how to code javascript...

Thanks!
Matt

gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4307
Have you looked at the following article with the AUC site?

Changing Another Field with Combo Box (Drop Down) Selection, http://www.acrobatusers.com/tech_corners/javascript_corner/tips/2006/change_another_field/

Drop Down Script to text field, http://www.acrobatusers.com/forums/ask_an_expert/questions/view/1984/

George Kaiser

libraboy
Registered: Dec 14 2007
Posts: 94
Do you still have sample for this thread? I need same dropdown.

please help

Thanks!
daka630
Expert
Registered: Mar 1 2007
Posts: 1420
Hi,
In older posts, the links to AUC learning resources are "broken".
This is because the Community was migrated to a new environment a while ago.
The resources are available but "relocated" as it were.

Start at the Learning Center page.
[url]http://www.acrobatusers.com/learning_center[/url]
Use this as the "hub". Links at the right permit a browse by topic.

Specifically for Acrobat JavaScript go to
[url]http://www.acrobatusers.com/topics/javascript[/url]
The link above is the first page of 8 that contain a tutorial summary and links to the tutorial.
There are 77 tutorials.
Use the Videos tab to view a summary of 3 available videos (links to videos are on the page).
Use the Articles tab to view a summary of 3 articles (links to these are on the page).

With some browsing you should be able to locate the resources George pointed to back in 2007.

Be well...

Be well...

pforms
Registered: Nov 17 2009
Posts: 87
On change event of your drop list:

if (xfa.event.newText ==" ")

{TextField1.rawValue = " "
TextField2.rawValue = " "
TextField3.rawValue = " "}
---------------------------------------------------------------
if (xfa.event.newText =="John Smith ")

{TextField1.rawValue = "1 Maple Street, Anytown, USA "
TextField2.rawValue = "youremail@?.com "
TextField3.rawValue = "771 777-7777 "}
----------------------------------------------------------------------
text field1 = address
2= email
3 = phone

Repeat this for each name