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 access/read the LABEL value
System
Hi there!
How to read the LABEL attribute value within a <option> tag using formAPI?
I'm able to get the VALUE attribute value with:
var ship_item = IWDatacapture.getItem("/shipname");
var ship_item_options = ship_item.getOptions();
var ship_item_SelectionIndex = ship_item.getValue();
var ship_code = ship_item_options[ship_item_SelectionIndex].value;
Is there a way to access/read the LABEL value similar to the one above?
Thanks!
Paulo Gouveia
Find more posts tagged with
Comments
Adam Stoller
I'm just guessing here - haven't tried this out - but perhaps:var ship_label = ship_item_options[ship_item_SelectionIndex].
text
Give it a try and let us know if it works.
--fish
(Interwoven Senior Technical Consultant)
Migrateduser
YES YES YES !!!
That WORKED !!!
Thanks Much!!!!!
Paulo Gouveia
Royal Caribbean and Celebrity Cruises
Information Tecnology
pawlr
any way to get a "label" value in a .tpl? or does this not get passed?
Adam Stoller
Probably not passed. If you want that information, you'd have to encode it into the value - or create a copy of the select list as a hidden set of values which contains the labels (but that sounds like a maintenance headache just waiting to happen, to me)
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Migrateduser
I don't make use of TPLs. But, if the LABEL is not passed from DCT to .TPL, then you should retrieve the LABEL from the same source that populated the SELECT in the DCT. If the VALUES/LABELS reside inside your DCT try to externalize them by making use of the <INLINE COMMAND ...>. Once externalized you should be able to read the VALUES/LABELS from the same source in both places. You'll need to do some coding though, but, from an architecture/maintenance point of view it'll be much cleaner.
Royal Caribbean Cruises
"<i>Delivering Great Vacations Through Information Technology</i>"