Copy link to clipboard
Copied
Dear Community,
I've a Listbox in adobe acrobat pro with following words: Telephone, Computer, Mobile, Notebook, if i select one or more words from the Listbox, the selected word should in a new Texflied for example :
1. Telephone
2. Mobile
3. Notebook
Many thanks for your answer/ help.
Best Regards
Noel
You can add a custom calculation script in the text field where you want the multiple selection values of the List Box to be populated into:
// Declare your variables
var f = this.getField("myListBox");
var a = f.currentValueIndices;
// Get multiple selections from the listbox and copy the values in this field
for (var i = 0; i < a.length; i ++)
//event.value += "\n"+ f.getItemAt(a[i], false);
event.value += f.getItemAt(a[i], false);
// Get single or more selections altogether from the list...
Copy link to clipboard
Copied
You can add a custom calculation script in the text field where you want the multiple selection values of the List Box to be populated into:
// Declare your variables
var f = this.getField("myListBox");
var a = f.currentValueIndices;
// Get multiple selections from the listbox and copy the values in this field
for (var i = 0; i < a.length; i ++)
//event.value += "\n"+ f.getItemAt(a[i], false);
event.value += f.getItemAt(a[i], false);
// Get single or more selections altogether from the listbox and populate this textfield
if ((typeof a == "number") && (a ==0)) event.value ="";
if (((event.value !=="") || (event.value =="")) && (typeof a == "number")) event.value += "\n"+ f.getItemAt(a, false);
And in the list box field refer to the slide below to see how to setup the listed items and field properties.
When you set it up like this you may make more than one selectin in the listbox by keeping the CTRL key pressed in your keyboard and left-clicking on items with your mouse pointer.
After the selections are made in your listbox, left-click once with the mouse pointer inside or on the text field where you have the custom script, and the values will autopopulate in that field.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now