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

Dropdown list script

realname
Registered: Aug 15 2008
Posts: 93

Hello,
I am new to scripting in Livecycle and would like to add a script to a drop down list. Basically I want to know if a script can be written where, once an item is selected from the drop down, a pop up window would appear with a definition of the selection. This doesn't absolutely have to be a pop up and could be a text field that changes the definition depending on the selection.

Can anyone help with a basic script to do this?

Thanks!

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Absolutely this is something you can do with JavaScript, or even FormCalc, on a LiveCycle Form. This article witll help you get started.

http://www.acrobatusers.com/tutorials/2007/js_list_combo_livecycle/

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/]http://www.adobe.com/devnet/acrobat/[/url]

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

realname
Registered: Aug 15 2008
Posts: 93
Thank you for your reply. I have tried and tried to get this to work but I just do not know enough about this and found the above tutorial much more elaborate than what I was looking for. I was hoping to simply do something such as, in my drop down list have the selections "Yes or No", if yes is chosen, a message appears in a text box. This is my basic solution but ultimately what I would like to happen is when the selection is moused over, this text box would appear.

Is this a very complicated script or can it (even the first part of making a selection and a message appears) be written by an if statement?
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Doing a mouse over popup of a list item is probably impossible. But writing something into a text field when an item is selected is simple.

Use something like this in the "Change" event for the drop down list

myTextField.rawValue = xfa.event.change;

Where "xfa.event.change" is the list item text. You could also do something like this

if(xfa.event.change == "Item1")
myTextField.rawValue = "This is item 1";
else if(xfa.event.change == "Item2")
myTextField.rawValue = "This is item 2";


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/]http://www.adobe.com/devnet/acrobat/[/url]

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