cancel
Showing results for 
Search instead for 
Did you mean: 

javascript lisbox issues

Former Member
0 Kudos

I am using Adobe Live cycle designer with javascript adding items to list box as

listbox.addItem("test","1");

while retrieving the lisbox values... am using

oField.items.nodes.item(k).value

so I am getting output as "test"

now I want to retrieve 1..

i tried using

oField.items.nodes.item(k).text && oField.items.nodes.item(k).rawValue

but this didnt work

Please suggest.

Accepted Solutions (1)

Accepted Solutions (1)

former_member226239
Contributor
0 Kudos

Try the following code:

var lbValues = listbox.rawValue.split("\n"); " Now all the values are in lbValues array

for (var i = 0; i < lbValues.length; i++)

{

xfa.host.messageBox(lbValues\[ i \]);

}

Thanks,

Chandra Indukuri

Former Member
0 Kudos

Thanks soo much...this worked for me to retrieve all the values...

but i want to retrieve the selected value....

for that do I have to get index and then get the value or can this be done dierctly?

Thanks again..

full points to you

former_member226239
Contributor
0 Kudos

Why do you need the index?

In the list box if the user can't select more than one entry then you can simply use: listbox.rawValue to get the selected value.

The sample code I wrote in my previous thread was to retrieve all the selected values if the user can select more than one.

Please close the thread if your issue has been resolved.

Former Member
0 Kudos

Thanks , I understood now

Answers (0)