title: jquery validation addMethod not working
body: <p>I have a div in jsp as follows:</p>
  
  <pre><code> &lt;input type="text" id="year" placeholder=" Year"  class="year"  name= "year" value=""/&gt;
  </code></pre>
  
  <p>I want to calculate the difference between current year and entered year. I have to show the error if the value does not lie within some range. This is my custome jquery validator function.</p>
  
  <pre><code>jQuery.validator.addMethod('validAge', function (value, element, params) {
      alert("inside add method");
      var currentYear = (new Date).getFullYear();
      var range = currentYear - $element.val();;
      if(range &gt;10 &amp;&amp; range&lt; 70) 
          {
          return  true;
          }
      return false;
  }),
  </code></pre>
  
  <p>But it is showing error at element.val
  I have defined the rule as </p>
  
  <pre><code> $('#signup_form').validate({ // initialize the plugin
  
      rules: {
          year: {
              validage: true,
             },
      },
      messages: {
          year: "Invalid year",
     },
     },
    });
  </code></pre>