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

Menu drop down menu troubles - adding values

KDCS
Registered: Sep 30 2009
Posts: 36
Answered

Is there a way to add values to the choices in a "Variables" list that can be totaled?

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
You'll have to be more specific. What exactly are you doing? What do you mean by a "Menu drop down"? are to you talking about a "drop-down" field or a popup menu?

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

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

KDCS
Registered: Sep 30 2009
Posts: 36
I created a drop down list like the one radzmar answered in the question just below mine. Now I want to add values to the items in the list.

I did create a form like the one in your tutorial Listing Program_Part 1, but if the values of the items listed are identical, then when you select one of them the listing reverts back to the first item of the same value.

Is there something else I can tell you?

Thanks.
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Yes and I believe this was discussed in the article. Obviously you can use a number as the value of a list item, but as you found out those numbers must be unique in the list. There is an easy solution to associating an arbitrary number (or any kind of data item) to a list item.

Create an array or JavaScript object (in a Script Object) that maps list selections to the numbers you want to add up. I believe this was one of the techniques shown in the article on Programming Lists, maybe in part 2.

You really need to work on asking better questions. Forum questions need to be short and concise. Do not assume anyone knows what you are talking about, because they don't. And don't make up words. Either use the standard nomenclature or explain it. Do not say "like in so and so's" post because no one is going to read it. Again, explain what it is you are doing.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

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