title: How can I validate a full name using addMethod in jQuery Validator?
body: <p>I'm currently using jQuery Validate to validate my form data, and I'm using regex for several fields to check validity using patterns. However, even after applying my new validation method via addMethod, the form still allows people to submit the form using only a first name in the full name field.</p>
  
  <p>For my full name field, I've already verified my regex works by testing it on the field without using novalidate on my form.</p>
  
  <p>Regex: <code>^([a-zA-Z]{2,}\s[a-zA-z]{1,}'?-?[a-zA-Z]{2,}\s?([a-zA-Z]{1,})?)</code></p>
  
  <p>addMethod attempt</p>
  
  <pre><code>jQuery.validator.addMethod("fullname", function(value, element) {
      return this.optional(element) || /^([a-zA-Z]{2,}\s[a-zA-z]{1,}'?-?[a-zA-Z]{2,}\s?([a-zA-Z]{1,})?)/.test(value);
  }, 'Please enter your full name.');
  </code></pre>
  
  <pre><code>&lt;input id="full-name" name="Full_Name" type="text" class="form-control" placeholder="John Doe" required&gt;
  </code></pre>
  
  <p>If a single name (e.g. John) is entered instead of a full name, my regex should mark it invalid and request the person's full name.</p>