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

Fill in one field dependant on another field

penguinmaster
Registered: Apr 14 2009
Posts: 3

I'm in the process of making a simple order form. What I'm looking to do is have the user select a department from a drop down list, and then the field below it automatically fill in with their user code.

I've included a link to the actual form if that helps people to look at.

http://facstaff.uww.edu/pellizzt/other/Pepsi%20Order%20Form.pdf

Basically user would select from the department name field, and the Distribution Point Number field would fill in with their account number.

Any help would be appreciated!

Regards,

Tom

caitlinjohnson
Registered: Aug 25 2010
Posts: 2
Hi Tom,

Were you able to figure out how to do this? I've been waiting for someone to reply to your post, as I'm trying to figure out how to do a similar thing in one of my forms!

Thanks!
Dimitri
Expert
Registered: Nov 1 2005
Posts: 1389
Hi caitlinjohnson,

This tutorial from the Learning Center should help you out and includes sample downloads to examine the code-
http://acrobatusers.com/tutorials/2007/10/list_and_combo_in_lc

Hope this helps,

Dimitri
WindJack Solutions
www.pdfscripting.com
www.windjack.com
pforms
Registered: Nov 17 2009
Posts: 87
A droplist named: Dept
A text Field named: usercode

java script on the droplist change event:

if (xfa.event.newText=="")
{usercode.rawValue=""}

example:

if (xfa.event.newText=="Home Goods")
{usercode.rawValue="12345"}

if (xfa.event.newText=="Maintenance")
{usercode.rawValue="6789"}

You will need a value for each dept in your drop list.

Hope this helps.
redsolar_eclips...
Registered: Mar 13 2009
Posts: 7
How can this be further implemented via say: If you choose a place from a dropdown list, then the choices of the next dropdown list are filtered for that choice?

i.e.: If I choose country - list (US, UK, etc.) I choose US - then State: list (Alabama, Georgia, etc.) if I choose Georgia, then City dropdown filters to cities in Georgia (Atlanta, Veldosta, etc.)

Any one has a clue, much appreciated
pforms
Registered: Nov 17 2009
Posts: 87
You could use a two dimensional array. Fairly complex to explain but an example is in the above mentioned tutorial