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)
Reading label of an item - textbox
Thiags
<item name="subCategory" colspan="3">
<label>Choose Sub-Category</label>
<description>
Choose the Sub-Category for this content.
</description>
<select required="t">
<option label="Fed Focus" value="Fed Focus" />
</select>
</item>
--------------------------------------
Using following script i could access the name and value of an item, Is there is a way to get the label name of an item ?
var item= IWDatacapture.getItem("/subCategory");
var itemName= item.getName();
var itemValue= item.getValue();
Find more posts tagged with
Comments
RoseRuby
Hi
Did u try this
label = item.getOptions()[item.getValue()].text;
Hope this is what u were asking for
Rose
Thiags
Hi Ruby,
It works for reading the label in a optional drop down .
I have a requirement to display an error message while validating a text box item.
How can I a read the label of a text box and display the same in an alert box ?
Thanks for all your help!
JonathonG
You don't mention what version of TeamSite you're using. As of 6.1, there isn't any supported way of getting the label for the item. I've run into this same issue before - trying to write generic error handling. It makes things difficult. We wrote the following
unsupported
hack function (works in 6.1, not tested in any other version):
function getItemLabel(itemObject)
{
return itemObject.itemImpl.label;
}
Hope it helps,
Jonathon
Interwoven Developer
Allstate, Inc.
Thiags
Hi Jonathan,
Thanks a ton..
It worked for me.
Really appreciate your help.
-Thiags
acezone
Hi Thiag,
Could you please share the same with me.. as how you got the label of an item.. I have the same requirement on my desk.
-- Ace