how to check the value of object htmldivelement in ServiceNow javascript
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2024 04:32 AM
Hi Team,
I am trying to get the variable value in one record producer and I wrote a on change client script and I'm getting the responses as "Vidya alert:[object HTMLDivElement]"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2024 04:38 AM
you are printing some variable which you have not defined
what are you trying to alert?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2024 04:42 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2024 05:19 AM
then you should use name of variable and get the value
alert(g_form.getValue('variableName'));
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2024 05:41 AM
You try this is onChange script.
alert('vidya alert '+newValue);
Please mark my answer correct and helpful if this works for you.