title: Extend JQuery Validator Plugin with custom method
body: <p>I added a custom validation method to validate a password. However, it does not matter if the JSON I get is: </p>
  
  <pre><code>{"success":true}
  </code></pre>
  
  <p>or: </p>
  
  <pre><code>{"success":false}
  </code></pre>
  
  <p>The field <em>password</em> never validates. </p>
  
  <pre><code>$(document).ready(function () {
      // Ad custom validation
      $.validator.addMethod('authenticate', function (value) {
          $.getJSON("./json/authenticate.do", { password: value }, function (json) {
              return (json.success == true) ? true : false;
          }
          );
      }, 'Wrong password');
  
      $('form#changePasswordForm').validate({
          rules: {
              repeat_new_password: { equalTo: "#new_password" },
              password: { authenticate: true }
          }, submitHandler: function (form) {
              $(form).ajaxSubmit({
                  dataType: "json",
                  success: function (json) {
                      alert("foo");
                  }
              });
          }
      });
  });
  </code></pre>
  
  <p>Any idea, what I am doing wrong?</p>