I am running 8.2 and I am having a problem returning the index value of item(s) selected in a List Box on my form in Designer.
I have a List Box that is populated by at webservice and everything works fine. I am able to display the selected name(s)s for the item(s) selected in the list box but I can't seem to get the index value. Below is my Javascript code.
var a = xfa.resolveNode("lbAccountGroup.value").nodes;
xfa.host.messageBox(a.item(0).value); //Display's selection only for verification.
Does anyone have any advice on how to do this? I have tried selectedIndex and index instead of value and nothing has worked.
Thank you in advance.
John
Solved! Go to Solution.
Views
Replies
Total Likes
What event is your code running on ....I would recommend the exit event. I would use ListBox1.selectIndex. Note that the index is 0 based and it is not set until you Exit (by default). There is a small checkbox (on the Object palette where you set the values) that allows you to set when you want the commit to happen. You can change it to Select if you need it as the user makes changes to the listbox. I woudl not use the technique that you are using where you query the DOM.
Paul
Views
Replies
Total Likes
What event is your code running on ....I would recommend the exit event. I would use ListBox1.selectIndex. Note that the index is 0 based and it is not set until you Exit (by default). There is a small checkbox (on the Object palette where you set the values) that allows you to set when you want the commit to happen. You can change it to Select if you need it as the user makes changes to the listbox. I woudl not use the technique that you are using where you query the DOM.
Paul
Views
Replies
Total Likes
If you look for "Getting the current or previous value of a drop-down list" in the Adobe LiveCycle Designer Help you should be able to find the code you're looking for.
Views
Replies
Total Likes