- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-07-2015 03:48 AM
Hi,
Can any one tell me how to get the display value of a Glide list from a client script?
Thanks in advance!!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-07-2015 07:43 AM
This should work. Just replace 'watch_list' with the name of your field.
var fieldName = 'watch_list';
var options = $(g_form.getTableName() + '.' + fieldName + '_nonedit').innerHTML;
alert(options);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-07-2015 07:43 AM
This should work. Just replace 'watch_list' with the name of your field.
var fieldName = 'watch_list';
var options = $(g_form.getTableName() + '.' + fieldName + '_nonedit').innerHTML;
alert(options);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-07-2015 10:29 AM
Hi Mark,
Could you please explain what sort of expression is this?
$(g_form.getTableName())

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-07-2015 11:25 AM
The '$' symbol is a prototype dom selector. The prototype library is something that has been included in ServiceNow for years and can make these types of client-side scripting exercises much simpler. It's basically the equivalent to 'gel' or 'document.getElementByID' in javascript. Everything within that is just the ID of that dom element on the page. The end result is this...
$('incident.watch_list_nonedit');
That will return the HTML element with the ID indicated as an object. At that point, you can access the attributes, one of which is 'innerHTML' (which contains the information on the selected options in this case).
Here is a link to the prototype documentation...
Prototype v1.7.2 API documentation | $
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2015 12:10 AM
Thanks a lot Mark for detailed clarification on this. DOM area is still newer thing to me
I was wondering seeing these expressions in CSS style sheet as well and couldn't related it to JEXL. I hope those are the same Prototype DOM selectors as well.