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

ListBox Selection

johnsonsw
Registered: May 19 2011
Posts: 3

Is there a way to only display listbox choices from a long listed listbox?
 
Scotty

My Product Information:
Acrobat Pro 9.4.3, Windows
try67
Online
Expert
Registered: Oct 30 2008
Posts: 2398
Do you mean that you want to display the selected values in a text box, or something like that?
It's possible, but the problem is the value only updates when you exit the list box. You can use something like this as the custom calculation code of a text box:

event.value = getField("List Box1").value.toString()

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

johnsonsw
Registered: May 19 2011
Posts: 3
If displaying selected values in a text box is the way to do it, can you assist me with that?

The objective was to display only the selected values from within the listbox, if that is possible.

Scotty


try67
Online
Expert
Registered: Oct 30 2008
Posts: 2398
That's what the script I provided does.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

johnsonsw
Registered: May 19 2011
Posts: 3
try67

Okay, that worked beautifully. However, can that script be adjusted so the selected items can be stacked in the text box, as opposed to a string, seperated by commas.

Scotty
try67
Online
Expert
Registered: Oct 30 2008
Posts: 2398
Try this:
event.value = getField("List Box1").value.toString().replace(/\,/g,"\r");

(make sure to set the text-box to multiline)

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com