title: how to validate date field in jquery addmethod
body: <p>I need to validate the entered date in the text box using jquery in <code>addmethod</code>. The date not be more than the date which is 1 year from current date and also to be in format <code>dd/mm/YYYY</code>. </p>
  
  <pre><code>jQuery.validator.addMethod("greaterThanToday", function(value, element) { 
  var now=new Date(); 
  if ( !/Invalid|NaN/.test(new Date(value)) ) { 
  return new Date(value) &gt; now; 
  } 
  return isNaN(value) || (parseFloat(value) &gt; now); }, "* The date should not be greater than today.");
  </code></pre>