Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
How to retrieve the selected values from a multiple select listbox?
InterwovenIsFun
the command iwitem.getvalue() returns number,number[] and string, but I need to know how to use this function to return the array of selected values.
i wrote the following code:
var item=Iwdatacapture.getitem("/Root/ListSet");
var label=item.getOptions[item.getValue()].text;
this function is working fine if I select a single value from the ListSet and print it, but this is not working when i select more than one value.
any suggestions on how to use this function?
Find more posts tagged with
Comments
vpatel
Of course it will not work....var label=item.getOptions[item.getValue()].text;
Let's disect this line a little bit:
item.getOptions[index] -- uses an index.
item.getValue -- if you select a "single" item then it'll return that index #. However, if you select more than one items, it'll return an array of selected indices. Your logic needs to handle both use cases. Current logic will only handle "single" selection and multiple selections.
HTH!
InterwovenIsFun
After writing the index, i got all the values of the listbox. but the problem is am getting all of them,and not the selected ones. the getvalue() option works with index?
InterwovenIsFun
I got the selected ones..thanks..for ur help