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

Adding to a drop down with a if statement.

dk3dknight
Registered: Jan 22 2008
Posts: 136
Answered

What im looking for, when a specific field is equal to a specific number, a entry into the list box is added.

//Example

if (TextField1=="10")
then add item "Apple" to DropDownList1
elseif (TextField1=="15")
then add item "Pie" to DropDownList1
endif

After reading the scripting reference I see examples of a dynamic drop down list but its usually referring to connect it with a data source, which I do not want to do.

Thanks in advance.

If you would like to see the form, just ask.

My Product Information:
LiveCycle Designer, Windows
suewhitehead
Registered: Jun 3 2008
Posts: 232
Search the Learning center's livecycle articles for Thom Parker's "Programming List and combo boxes" article. With it you can learn how to make the entry in one field change the entry in the second field.
This will not have a database connection involved.
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4307
LiveCycle Designer includes a "Scripting Reference" under its "Help" menu item.

You can search for the "additem" method you will find an explanation on how to use this method.

George Kaiser

dk3dknight
Registered: Jan 22 2008
Posts: 136
Wow thanks that just what I needed I had looked but its obviously I didn't know what I was looking for.

For future generations the sample code looks like this.

DropDownList1.addItem("Human Resources")

Im attempting to build a Role Playing Battler Game and im going to use this to insert new skills when the player hits a specific level.

This solves alot of problems Thank You.

A view of the last build
http://farm3.static.flickr.com/2571/3969616916_11902e081b_b.jpg