- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-04-2022 10:20 AM
I want to allow user to select date and time if is more than 15 minutes from current date and time. Below onChange client script I am not able to select previous date but I am able to select anytime after current time. I want to allow only to select when time is 15 minutes or more from current time.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
//Type appropriate comment here, and begin script below
var date = new Date();
var sd = new Date(getDateFromFormat(g_form.getValue('date'), g_user_date_time_format));
if (sd < date) {
g_form.clearValue('date);
g_form.showFieldMsg('date', "Start date must be in the future.", 'error');
jslog('txt');
}
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2022 07:49 AM
Is working but after I submit a form with correct time and go back and change time to less than 15 minutes is updating the form without any error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2022 07:49 AM
Is working but after I submit a form with correct time and go back and change time to less than 15 minutes is updating the form without any error

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2022 09:26 AM
Hi Zuri,
Can you please share the usecase in detail?
Regards,
Nikhil Kumar M

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2022 08:31 PM
Hi Zuri,
If my solution helped you in anyway. Please mark it as helpful and mark as correct if that fulfilled your requirement.
Thanks & Regards,
Nikhil Kumar M

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2022 08:35 PM
Hi Zuri,
If my solution helped you anyway. Then please mark it as helpful and mark as correct if that fulfilled your requirement.
Thanks & Regards,
Nikhil Kumar M