- 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: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:34 AM
Thanks alot! that solved it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-09-2020 02:37 AM
Do the name attribute and id attribute in general need to be the same value?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-09-2020 02:42 AM
Just to be on safer side keep both the name and the id attribute value as same.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader