Expand my Community achievements bar.

Populating a text box from a list box

Avatar

Level 3

I created a form that when you click on a checkbox in the table row a list box appears, the list box allows multiple selections and so on.  How do you get the list box selection to populate in the text box in each table row??  Any help on this is much appreciated...thank you!

2 Replies

Avatar

Level 10

If you allow multiple selections in ListBox, then the rawValue will have all the selected values separated by a new line character.

You can use the following code to get all the selected values from the Multi select list box.

var vList = ListBox1.rawValue.split("\n");

for (var i = 0; i < vList.length; i++)
     xfa.host.messageBox("Selected Values - " +  vList[i]);

Thanks

Srini

Avatar

Level 1

Help....

I am working the same issue, and keep running into a wall

{

// Incoming information

// Listbox name is GroundsIssues

// The following code is -in- the "Selection Changed" tab

console.println(" Listbox has changed ");   //this print out OK

var vList = GroundsIssues.rawValue.split("\n");

console.println(" Listbox value is " + vList);  //this SHOULD print out the list of selected items, but it never gets here.

}

I keep getting a "GroundsIssues is not defined" when this code is -IN- the "GroundIssues" box tab....