I need to make variable Date(Requested by date) in such a way so that user cannot select past dates.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-06-2016 09:23 AM
Hi All,
I have a variable set applied on service catalog item, in that "Requested by date" is a variable with type as date/time, I want if user selects date as current/previous date he should not be able to submit the request or alternatively past dates can be shown as readonly, he/she should not be able to select date in that scenario. Below is the screenshot attached.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-06-2016 09:09 PM
Write an on change client script in the Requested by date field.
function onChange(control, oldValue, newValue, isLoading){
if (isLoading || newValue == '') {
return;
}
if(newValue != '')
{
var reqDate = new Date(getDateFromFormat(newValue, g_user_date_format));
var today = new Date();
if(reqDate.getTime() <= today.getTime()) {
alert('Please select future date values');
}
}
}
Thanks,
Mihir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2016 12:01 AM
Hey Mihir,
Not Working.. this shows error even when we are selecting future dates as well and also if I select past dates I'm able to submit the request.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2016 12:19 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-06-2016 11:44 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2016 12:04 AM