title: jquery Validate time required
body: <p>I have been looking for a decent jQuery validation methodology.  I found this jsFiddle <a href="http://jsfiddle.net/e2DzT/" rel="nofollow">That does something similar</a></p>
  
  <p>But I need mine to validate with AM\PM and also not be a required field for form submission.  And If I could get this to work onBlur only then that would be great.</p>
  
  <p>An example acceptable time would be</p>
  
  <pre><code>12:00 AM
  </code></pre>
  
  <p>While there is an infinite example of unacceptable strings, this is just one of them</p>
  
  <pre><code>24:00
  </code></pre>
  
  <p>Now that I think about it, I would want this thing not to submit if the format is not valid, but If there is no entered time, I don't want the validator to fire.
  Tried this with the jquery validator, but it is not working.</p>
  
  <pre><code>$().ready(function() {
  
  $.validator.addMethod("time", function(value, element) {  
  return this.optional(element) || /^(([0-1]?[0-2])|([2][0-3])):([0-5]?[0-9])(a|p)m?$/i.test(value);  
  }, "Please enter a valid time.");
  
      $("#login").validate({
              rules: {
                      time: "required time",
              },
  
      });
  
  });
  </code></pre>