title: error class not removing after enter correct date format in text field using jquery
body: <p>Currently working on jquery date picker where if user enter some random numbers other the correct date format an error message will come in the top and alert will come then red border will come in text field. with my current code i am getting this perfectly but if user enter the correct date errRed class and top label  message was not hiding.</p>
  
  <p>Here is the <a href="http://jsfiddle.net/karthic2914/akwb5r3L/5/" rel="nofollow">fiddle link</a></p>
  
  <p>Here is my code</p>
  
  <pre><code>&lt;span id="error_message" class="error_msge"&gt;
  
  &lt;/span&gt; 
  &lt;div&gt;&amp;nbsp;&lt;/div&gt;
   &lt;form autocomplete="off" class="basicForm" id="basicForm" method="POST" action="education_health.html"&gt;
    &lt;input type="text" placeholder="MM/DD/YYYY" class="ipt_Field txt_Idt ipt_required" id="txt_Idt" name="txt_Idt" /&gt;
   &lt;/form&gt;
  </code></pre>
  
  <p>Here is the jquery code which i am trying</p>
  
  <pre><code>$('.txt_Idt').change(function (event) {
      var txtVal = $('.txt_Idt').val();
      //alert("check what" + txtVal);
      if (isDate(txtVal)) {
          $(".basicForm").validate().element(".txt_Idt");
          $(".basicForm").find(".txt_Idt").removeClass("errRed");
          event.stopImmediatePropagation();
      } else {
          alert('Kindly enter date in valid format');
          $("#txt_Idt").addClass("errRed");
          $(".txt_Idt").val("");
          $(".basicForm").validate().element(".txt_Idt");
          event.stopImmediatePropagation();
      }
      return false;
  });
  
  function isDate(txt_Idt) {
      var currVal = txt_Idt;
      if (currVal == '') return false;
  
      var rxDatePattern = /^\d{2}[./-]\d{2}[./-]\d{4}$/; //Declare Regex
      var dtArray = currVal.match(rxDatePattern); // is format OK?
  
      if (dtArray == null) return false;
  
      //Checks for mm/dd/yyyy format.
      dtMonth = dtArray[3];
      dtDay = dtArray[5];
      dtYear = dtArray[1];
  
      if (dtMonth &lt; 1 || dtMonth &gt; 12) return false;
      else if (dtDay &lt; 1 || dtDay &gt; 31) return false;
      else if ((dtMonth == 4 || dtMonth == 6 || dtMonth == 9 || dtMonth == 11) &amp;&amp; dtDay == 31) return false;
      else if (dtMonth == 2) {
          var isleap = (dtYear % 4 == 0 &amp;&amp; (dtYear % 100 != 0 || dtYear % 400 == 0));
          if (dtDay &gt; 29 || (dtDay == 29 &amp;&amp; !isleap)) return false;
      }
      return true;
  }
  </code></pre>
  
  <p>I tried something like this </p>
  
  <pre><code>$(".basicForm").find(".txt_Idt").removeClass("errRed");
  </code></pre>
  
  <p>but still no use </p>
  
  <p>Thanks in advance</p>