[jQuery] Client Side Date Validations Using Query
What I'm trying to do seems like it should be really simple but
roadblocks keep coming up so any help would be appreciated.
Basically what I want to do is a check to ensure the date the user
entered is less then the current date.
Below is some mock code of how it should work.
$.validator.addMethod("ValidDate", function(value, element) {
var currentdate = new Date()
var userdate = new Date(Value)
if (userdate < currentdate ) {
return true;
}
return false;
}, "Invalid Date.");
This also have various problems ....
$.validator.addMethod("ValidDate", function(value, element) {
var currentdate = new Date()
var userdate = new Date(Value)
if (userdate.getTime() < currentdate,getTime() ) {
return true;
}
return false;
}, "Invalid Date.");
Thanks again for any suggestions.