Multiple selections from drop down list or list box to text field | Community
Skip to main content
Level 2
November 21, 2025
Question

Multiple selections from drop down list or list box to text field

  • November 21, 2025
  • 1 reply
  • 197 views

Hi gurus,

 

I came across the situation where I want to select multiple value from list box and display those selected values to Text field.

For eg: Lets say we have 2 fields. one is  list box. another is Text field. My  List box contains 

Red

Blue

Green

Yellow

Black

If user selects Red, Blue and Yellow. Then I want to display these 3 values on the Text field simultaneously.

Now, I have seen the code where  var v = this.getField("ListBox1"); but the issue is I dont have this functionality(this.getField) in my adobe livecycle designer.Attached ss of not having functionality. so can you pls provide js or any solution through which I can resolve this. 

 

1 reply

VishalKa5
Level 5
November 21, 2025

Hi @fastdo,

 

In LiveCycle Designer (XDP forms), you cannot use this.getField() like in Acrobat forms. Instead, each field is accessed directly by its field name and you use FormCalc or JavaScript inside the form object.

For a list box with multi-select enabled, the selected values are stored as an array, so you simply read that array and join it into a string, then set it into the text field.

JavaScript solution (LiveCycle Designer):
Add this code in the change event of the list box: 

var items = ListBox1.rawValue; // returns array of selected values if (items !== null) { TextField1.rawValue = items.join(", "); }

This will display:
Red, Blue, Yellow in the text field after the user selects those values.

 

note:

  • Use rawValue in LiveCycle Designer (not this.getField).
  • Make sure the list box is set to Allow multiple selection in its properties.
  • The text field must be a normal text field (not calculated unless you use calculate event).

Summary:
LiveCycle doesn’t support Acrobat’s this.getField(). Instead, read the list box’s rawValue array and join it into the text field using simple JavaScript.

 

Thanks

fastdoAuthor
Level 2
November 21, 2025

Thank you for the reply. I am quite not successful in getting selected values(Red, Blue, Yellow) from list box. I used  

var oItems = xfa.resolveNode("this.#items"); var nItemsLength = oItems.nodes.length; for (nItemCount = 0; nItemCount < nItemsLength; nItemCount++){ if (textField1.rawValue == null) { TextField2.rawValue = oItems.nodes.item(nItemCount).value; } else { textField1.rawValue = textField1.rawValue + "\n" + oItems.nodes.item(nItemCount).value; } }

but this gave me all the values(all 5 colors) from list box. Wrote this in List Box field. in How do I get only selected values from list box?

VishalKa5
Level 5
November 21, 2025

Hi @vishalka5 ,

I have added the same logic but something is wrong as I am not able to retrieve the selected value. I have attached 2 files. One ss from adobe live cycle and another output pdf

 


Hi @fastdo ,

 

If this.rawValue is returning null or not giving the selected values, it means the list box is not configured for multi-select or the event is in the wrong place.

 

Thanks,

Vishal