getcontrol vs getelement
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2017 01:56 AM
Hi Folks,
Would like to understand the difference between getelement and getcontrol in client scripting?
Thanks,
Aman
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2017 03:07 AM
Hi amaneet,
i find this link in community Get Element value - scripting
please have look for 10.3 and 10.6 chapters
GlideForm (g form) - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2017 03:09 AM
Hi Amaneet,
getControl() method uses the field name while getElement() uses the ID of the element from the page. Moreover getControl() is similar to document.getElementById('id'). It gets the element with the field name you specify (not an id). It's important for fields like Reference fields which are actually made up of several different input fields in the DOM (one for the sys_id, one for the display value, etc). getControl() knows which input element to get.