- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2016 06:45 AM
Hi
I am trying to create UI page and access values of UI element in Client script.
Ex - I had created UI page as
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:ui_form>
<g:ui_reference query="QUERY:active=true" name="user_id" id="user_id" table="sys_user" />
</g:ui_form>
</j:jelly>
and I tried to access the value of ui_refernce element in client script by
var id = g_form.getValue('user_id');
but in client script, i am unable to access the value of UI elements.
Can anyone please help me.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2016 06:58 AM
Hi Anand,
g_form is not available in UI Pages. You will have to use DOM manipulation (either document.getElementById() or gel() calls). This is the only place in ServiceNow where DOM access is approved in client scripts.
http://wiki.servicenow.com/index.php?title=UI_Pages

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2016 06:58 AM
Hi Anand,
g_form is not available in UI Pages. You will have to use DOM manipulation (either document.getElementById() or gel() calls). This is the only place in ServiceNow where DOM access is approved in client scripts.
http://wiki.servicenow.com/index.php?title=UI_Pages