title: Cannot call method 'addMethod' of undefined
body: <p>Getting "cannot call method 'addMethod' of undefined" when browser executes the below line fo code.</p>
  
  <pre><code>$.validator.addMethod("regex", function (value, element, param){
      return this.optional(element) || param.test(value);
  });
  </code></pre>