I'm attempting to write some jquery from the first time and I'm using the validatation plugin.
as you can see in my code, i just want to print out the value of the Date object.
$.validator.addMethod(
"testDate",
function(value, element)
{
var currentDate = new Date();
var dateObj = new Date(value);
if(element == "dob")
{
if(dateObj > currentDate)
{
console.log(currentDate);
console.log(dateObj);
return false;
}
}
else if(element == "scheduledExamDate")
{
if((dateObj.getFullYear() > currentDate.getFullYear()+1)||(dateObj.getTime() < currentDate.getTime()))
{
return false;
}
}
});