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

Displayed text of Dropdown list with bound values

tgoodman
Registered: Aug 18 2008
Posts: 72
Answered

I'm sure this is simple and may have been asked before (sorry I can't find it).

If a dropdown list has bound values, in javascript, how do you interrogate the displayed text of the field..

DropdownList1.rawValue returns the bound value, so how would you get the text?

Thanks

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Have you looked at this article on Using Lists? It covers exactly this issue and many more list handling features:

http://www.acrobatusers.com/tutorials/2007/10/list_and_combo_in_lc

The short answer is that you use the function:

.getDisplayItem(nIdx);You'll find this and other very useful properties and function in the XML Form Object Model Reference:

http://partners.adobe.com/public/developer/xml/topic.php


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

tgoodman
Registered: Aug 18 2008
Posts: 72
Thanks Thom ...

I found simpler solution though:

DropDownList1.formattedValue
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
That's an excellent solution!! I'll be using it in the future. Thanks for sharing!

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