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)
Selectbox Value
kaalraa
Hi,
We have a DCT in which a drop down is being populated through the database.
{option value='1'} House
{option value='2'} Car
Now from this when i use IWDatacapture.getItem("/FIELDNAME").getValue() i am getting the value as 1 or 2. Whereas i am looking out to get the text ... which is House or Car.
Find more posts tagged with
Comments
jbonifaci
RTFM on getOptions.
~Jeff
kaalraa
Thanks Jeff... also i had gone through the same before putting up to the forum, however does not get success.
RTFM on getOptions.
~Jeff
If any one has done that earlier... please share the concept or a snippet.
jbonifaci
It's pretty simple and straight forward. You use getOptions to get the options array. You use getValue to get the selected values. Put them together and you get the selected options. You then use the properties of the selected option object to get the value and the label. (.value and .text). i.e.:
var itemOptions = itemObject.getOptions();
itemOptions[selectedValue].value;
itemOptions[selectedValue].text;
~Jeff