Get TEXT from select box
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-31-2012 08:26 AM
Hi,
I have a select box with some options that are shown, but when I select some option I get the value of the selection, not the name for example:
option in the select box # 1 is "Main avenue 133" but value of this selection is "001". I need to get the "Main avenue..." value.
thank you in advance.
Daniel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-31-2012 08:42 AM
Client side (Client Script) you can do something like this... Assuming you are on the incident form and your choice field's name is 'your_choice_field.'
var myVal = gel('incident.your_choice_field');
alert(myVal.options[myVal.selectedIndex].text);
Server side (Business Rule):
var myVal = current.your_choice_field.getDisplayValue()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-31-2012 10:10 AM
thank you, that solve my question 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-31-2012 08:58 AM
Note that relying on either in a multi-language environment is ill-advised 🙂

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-29-2015 03:58 PM