Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Getting multiple option labels for a select item
herald10
Hi,
I have a select item in a DCT. When user selects multiple options, I would like to be able to get the label of each of the selected options. But getValue on that item returns a comma separated list. How can I get each of them seperately?
Ex: 0,1,5. Is there some function like split to do that?
Thanks
-H
Find more posts tagged with
Comments
Nicholas
Just try this..
item = IWDatacapture.getItem("/d");
label = item.getOptions()[item.getValue()].text;
Thanks Nicholas
Michael
Hi
Yes JavaScript has a split function.
var myString = item.getValue();
var myArray = myString.split(",");
(Something like that anyway - I haven't tested this)
You could then iterate over that array and get the label values - as shown in the previous post on this thread.
HTH
Cheers
Michael