title: jquery validator, can't set class name correctly for error labels
body: <pre><code>    var validator = $("#form1").validate({
          rules: {
              name: "required",
          },
          messages: {
              name: "Name Required",
          },
          submitHandler: mySubmitHandler,
          success: "valid",
          errorClass: "invalid"
      });
  </code></pre>
  
  <p>I have above code to add jquery validation in a form.</p>
  
  <p><strong>Problem: When input is invalid it adds 'invalid' class to error label. Then when valid it adds 'valid'. but when once it's invalid after valid, it does not remove valid class.</strong></p>
  
  <p>1> invalid - label has invalid class now</p>
  
  <p>2> valid   - label has 'invalid valid' class now</p>
  
  <p>3> invalid - label has 'invalid valid' class now</p>
  
  <p><strong>am i missing some implementation or how it suppose to be used?</strong></p>
  
  <p>Only custom thing i am trying to implement is adding an image with error label using class.</p>