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

positioning a combo box

tnsesac
Registered: Jan 8 2010
Posts: 3

How do I position a combo box to the value taken from a variable in the URL?
For example if "state=CA" in URL, I need to position the state combo box to "California".
I tried setting "state.selectedIndex=" a value like 5 or 8 or some number, but it doesn't seem to work.
Thanks

My Product Information:
Acrobat Pro 9.2, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Is this a LiveCycle form? or an AcroForm? "selectedIndex" is a LiveCycle property.

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

tnsesac
Registered: Jan 8 2010
Posts: 3
It is not LiveCycle. It is AcroForm.
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Ok then you need to use properties and functions in the Acrobat JavaScript DOM. I'd suggest downloading the Acrobat JavaScript Reference (linked in my signature block). Also read this article:

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

It shows how to use the "currentValueIndices" property, which is anologous to the "selectedIndex" in LiveCycle scripting.

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