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

Create combo box selection from selection made on another combo box

shawnash
Registered: Dec 16 2009
Posts: 48

Hello,
 
I have a form that I have field1 that will have multiple selections. Based on what is selected from field1, I have 2 text boxes that are populated. I would like to have something like a cascaded prompt for one of the text boxes (so I assume I would need to change that one to be a combo box.) Based on what is selected from field1, field3 would have a list of selections. Is this possible?
 
I am using Acrobat 5, but if an upgraded version would have this option, I could get a newer version.
 
Thanks in advance - any help is appreciated...
Shawn

My Product Information:
Acrobat Standard 5.x or older, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Read this article:
http://acrobatusers.com/tutorials/2007/js_list_combo_livecycle/

There is a lot more info on this topic, and better samples at www.pdfscripting.com

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

shawnash
Registered: Dec 16 2009
Posts: 48
Thank you for the reply. Do you have to have livecycle in order to do this, or can it be done in Acrobat?
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Of course not. While the word "LiveCycle" is in the link to the article, the article (and the samples) actually cover techniques for both AcroForm and XFA Forms.

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

shawnash
Registered: Dec 16 2009
Posts: 48
I like the example for the XFA form - that is how I really need it to look. Is there a way to do that in AcroForms?

Also, am I understanding correctly that you put the list in a document level script and then the rest of the code gets put into the action for the first field that will have the first selections and then there is code that will also be in the second field that holds the cascaded selections?
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Which example files are you looking at? They are supposed to be very similar,i.e., each shows how to implement the same solution in the two different forms technologies.

The data is placed in a global space (the doc level script for an AcroForm) to make it available to the entire document. This is a "best practices" technique. And of course, in many real world applications this kind of data will be used by more than one script, so it needs to be global. But, it is not strictly necessary to make the data global if it is only used in one place.

The "Action" code (the auto-populate code) must be triggered by the user selection on the drop-down. This is what drives the selection of the event.

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

shawnash
Registered: Dec 16 2009
Posts: 48
Thank you so much, I figured it out. :)