Date Validation

Date Validation

I added a validation for a date field to check whether user is selecting a past date.

I used below script in On_user_input field action:

if (input.Date_field  <  zoho.currentdate)
{
    alert("Not Allowed!");
    input.Date_field = zoho.currentdate;
}

It works the first time I select a past date but after closing the alert box, I am able to select a past date. I tried this several times and found it to be an intermittent problem.