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

Add a list to a static dropdown on a form

cl5792
Registered: Jul 17 2008
Posts: 53

I have the need to add a dropdown to a form that will have a static list of names. What is the best method to do this? JavaScript? Also, can it be contained within the distributed Dynamic PDF. I am using Acrobat 8 and LifeCycle Designer.

One other step - if I have a second value (id#) for each name. Can I populate the bound dropdown with that value but only display the name for selection? I can have the list in either a XML file or pulled from SQL. But, it need to be available in the stand-one PDF, offline.

Thanks for your assistance.

dk3dknight
Registered: Jan 22 2008
Posts: 136
I hope this helps you.

Lori's Corner
Providing interactive database lookup from forms
Read this tip to learn how to use LiveCycle Designer to write data to and retrieve information from databases.
by Lori DeFurio
Download [PDF: 612 KB]

http://partners.adobe.com/public/developer/en/livecycle/lc_designer_db_lookup_tip.pdf
cl5792
Registered: Jul 17 2008
Posts: 53
This was helpful, but I do not need the user to connect to a datasource. I need to have the data for the dropdown already in the PDF. They will choose from the list, that will not change. The list is over 100 items so entering it manually into the dropdown will not work well. How can I prepopulate the dropdown list before sending out the PDF.

Thanks,
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4307
You can use the 'addItem()' method for a dropdownlist.

From the "Scripting Refernece" under the "Help" menu option:

"addItem - Adds an item to the list of items contained within a drop-down list or a list box.
Syntax - SOM_expression.addItem( STRING param1 [, STRING param2 ] )

Parameters -
param1 - The string representing the display value.
param2 - (Optional) The string representing the bound value.

Returns - Empty

Examples"
● DropDownList1.addItem(“Human Resources”)
● DropDownList1.additem(“Human Resources”, “10”)
● ListBox1.addItem(“Yellow”)
● ListBox1.addItem(“Yellow”, “2”)
● ListBox1.addItem(DropDownList1.rawValue, “3”) "

With some creative editing or use of macros in an editor one should be able to inster the necessary text and quotation marks as needed.

George Kaiser