- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2016 12:18 PM
What I'm trying to accomplish is that: Start Date cannot be in the past
This is my script:
but my problem is that , I need to be able to select today's date as well, but with this script it doesn't let me .
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var today = new Date().getTime();
var start = new Date(g_form.getValue('start_date'));
g_form.hideFieldMsg('start_date', true);
if(start<today)
{
g_form.showFieldMsg('start_date','Start date cannot be in the past','error');
g_form.clearValue('start_date');
}
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2016 09:10 PM
Write a UI policy with the following condition :
Write following script :
function onCondition() {
g_form.setValue('date_of_joining', '');
alert("Enter valid date");
}
This is working fine for me. Try it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2016 08:43 AM
Works as expected. Thanks a lot !!