title: How do I make an input password only get validated if it is filled in while editing a user?
body: <p>I am using Jquery with Validator plugin.</p>
  
  <p>What I want to happen: When I popup a modal to edit a user I only want the password to be validated IF there is a password entered. I have this part covered. But if I begin to enter a password and then ultimately decide to erase it and move on it is still getting validated even though it is empty.</p>
  
  <p>So if I never touch the password it doesn't get validated and this is what I want. If I do type and then remove what I typed it still tries to validate. This is not what I want. I want it to realize I decided against entering a new password for the user and again skip attempting to validate it.</p>
  
  <pre><code>$(document).ready(function() {
    $("#epassword").focusout(function() {
      if ($(this).val().length &gt; 0) {
        $("#editgirlform").validate({
          rules: {
            password: {
            required: false,
            pwcheck: true,
            minlength: 6
          }
        },
          messages: {
            password: {
            required: "Password required",
            pwcheck: "Password must have at least 1 lowercase letter and 1 number!",
            minlength: "The password must be at least 6 characters!"
          }
        }
      });
    }
  });
  </code></pre>
  
  <p>$.validator.addMethod("pwcheck", function(value) {
       return /^[A-Za-z0-9\d=!-@._<em>]</em>$/.test(value) // consists of only these
              &amp;&amp; /[a-z]/.test(value) // has a lowercase letter
             &amp;&amp; /\d/.test(value) // has a digit
     });
     }</p>