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

Auto Populate List Box based on Drop Down List Selection

DJ'sGiGi
Registered: Apr 27 2011
Posts: 2

I have read several threads & still remain thoroughly confused on the topic. I have created a form with 6 selections in a drop down box. I then created a list box that I'm attempting to populate with three lines of text based on the the selection in the drop box. Can someone please HEEEELLLLPPPP!!!! I'm very new to LiveCycle & Adobe Forms so a plain english explanation would be awesome (picutres be awesom.

~ Please consider the environment ~

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Have you read this article?
http://acrobatusers.com/tutorials/2007/js_list_combo_livecycle/

It contains examples of exactly the functionality you are looking for.

To copy entries between list controls (this droplist is also a list control) requires a script. So the first bit is to learn a bit about scripting in LiveCycle Designer.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

DJ'sGiGi
Registered: Apr 27 2011
Posts: 2
Thanks for your response. I read the article several times both yesterday and today and have attempted to duplicate the script with a couple of modifications because my users won't need to make a selection from the second box because the text in the second box always applies based on their selection. For instance, if they select "Public Safety" in drop down box 1 (named ResultAreaList, there are 3 criteria that apply only to Public Saftey. The script I'm using is below.

var oResultAreaList = {
Children & Families: [ ["-","None"], ["High school graduation rate"], ["Youth crime and violence rates"],["Childhood obesity rate"]],
Economic Development: [ ["-","None"], ["Per capita income"], ["Net new jobs"],[" Perception of business climate, as measured by survey of businesses"]],
Innovation: [ ["-","None"], ["Number and impact of technology-based innovations in crime, blight and city services"], ["Return on investment for innovations that demonstrate savings or generate new revenue of $100,000 or more annually"], ["Number of projects receiving formal recognition by a national organization, third party or citizens"]],
Open & Effective Government: [ ["-","None"], ["Citizen perception of trust in government as measured with customer surveys and related data"], ["Efficiency and effectiveness measured by the number of process improvement projects across City government that improve results and/or save money"], ["Number of audit findings"]],
};




~ Please consider the environment ~

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
You're list looks fine. All the code needs to do is apply a selection from this object to the drop list.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

Twilliamsephc
Registered: Oct 25 2011
Posts: 1
Ok, I read the article but not exactly what I am looking for. I have read many posts regarding this an still cant figure it out. vidoe tutorial or photos would really help.


I would like to choose a City from my dropdown and have it auto populate the Zip(text field). Not sure what to do next. Do I have to assign a value to the items in the dropdowns? I am very very new to this program as well as this whole scripting thing. Please Help.
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
There are two ways to approach using a drop list to populate another field.

1. You can assign an export value to each item in the list, and then when an item is selected apply the export to another field. The problem with this approach is that each item in a list must have a unique export value. So you could not use this method if two cities on the list had the same zip. Probably not an issue.

2. Use an external object (or data source) to store the information that will be placed in the other fields. Items in this external object must be referenced using the name of the list items.


Both of these solutions are provided in the article. Take another look.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script