- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-09-2020 02:08 AM
Hello,
I am working on implementing a date picker for a UI page. I have the following snippet in my HTML code-field:
<g:ui_date class = "form-control" id = "wt_start" name="work_time_start" value="${sysparm_start_date}"/>
Which displays like this:
which is fine. I am having issues retrieving this date in my client script. I have the following line:
var strDoc = gel("wt_start").value;
but it doesn't work... could anyone help?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-09-2020 02:32 AM
you need to include the name attribute as well in the tag without which it won't work
so update as below
<g:ui_date class = "form-control" name="wt_start" id = "wt_start" name="work_time_start" value="${sysparm_start_date}"/>
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-09-2020 02:11 AM
Hi,
You can just use JQuery to get the value: $("wt_start").value
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-09-2020 02:20 AM
Just like that? It doesn't seem to work.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-09-2020 02:30 AM
Can you provide images / script from all sections of your UI Page so we can verify it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-09-2020 02:25 AM
Hi,
Did you verify by adding alert?
what value it is giving?
is it empty or undefined?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader