I have a .net custom validator set up to validate an input date in a form. The validation should check the number of days in February, allowing 28/02/2015 but not 29/02/2015.
The C# server validation is functioning correctly with the following code snippet:
try
{
DateTime dt = DateTime.Parse("29/02/2015");
}
catch
{
args.IsValid = false;
}
This will return false when validated;
However, I am struggling to replicate the same behavior for client-side validation using JavaScript. Is there a straightforward way to achieve this in JavaScript?