title: JQUERY Datepicker - validation error doesn't go away after selecting a date from datepicker
body: <p>I am using jquery datepicker and it seems there are some issues with validation error. After validation error if i select a date from datepicker then validation message doesn't go away. It disappears if i select the date second time.</p>
  
  <p>Here are the steps to reproduce this;</p>
  
  <p>1- Type in wrong date format.
  2- Invalid date format error will be shown.
  3- Now select a date from the datepicker.
  4- Error message showon in steps two is still there.</p>
  
  <p>I have done some research on this and have tried the solution given on this link with no luck. </p>
  
  <p><a href="https://stackoverflow.com/questions/2287011/jquery-datepicker-validation-message-issue">jQuery datepicker validation message issue</a></p>
  
  <p>Here is my code;</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$("#date").datepicker({
    dateFormat: 'dd/mm/yy'
  });
  
  $('form').validate({
    rules: {
      date: {
        required: true,
        dateISO: true
      }
    },
    messages: {
      date: {
        required: "Date required",
        dateISO: "Invalid date. Must be formatted dd/mm/yy"
      }
    }
  });
  
  
  $.validator.addMethod('date',
    function(value, element) {
  
      if (this.optional(element)) {
        return true;
      }
  
      var ok = true;
      try {
        $.datepicker.parseDate('dd/mm/yy', value);
      } catch (err) {
        ok = false;
      }
      return ok;
    });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.10.0/jquery.validate.js"&gt;&lt;/script&gt;
  &lt;script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"&gt;&lt;/script&gt;
  &lt;link href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" rel="stylesheet"/&gt;
  
  &lt;form&gt;
    &lt;input id="date" name="date" /&gt;
  &lt;/form&gt;</code></pre>
  </div>
  </div>
  </p>