Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2024 11:04 PM - edited 12-23-2024 11:04 PM
Hi @thaduri sai ,
try below code.
function onSubmit() {
var requestedEndDate = g_form.getValue('end_date');
var requestedStartDate = g_form.getValue('start_date');
var format = g_user_date_time_format;
var startDateMs = getDateFromFormat(requestedStartDate, format);
var endDateMs = getDateFromFormat(requestedEndDate, format);
if (startDateMs > endDateMs) {
g_form.showFieldMsg('end_date', 'End date should be later than start date.', 'error');
return false;
}
}
-------------------------------------------------------------------------
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay
-------------------------------------------------------------------------