title: How to manually invalidate fields after AJAX call with jQuery validate
body: <p>Note: the below code is just for demonstration and I am using jQuery and jQuery validate plugin.</p>
  
  <p>Suppose I have a form with two fields (email and inventory number):</p>
  
  <pre><code>&lt;form action="/something" method="post" id="demoForm"&gt;
       Inventory No: &lt;input type="text" class="required" name="inventory_no" /&gt;
       Email: &lt;input type="text" class="required" name="email" /&gt;
       &lt;input type='submit' value='submit' /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Binding plugin to form:</p>
  
  <pre><code>jQuery(function(){
      jQuery('#demoForm').validate();
  });
  
  //handle user submit
  
  jQuery('#demoForm').bind('submit', function (e) {
      e.preventDefault();
  
      if (jQuery(e.target).valid()) {
          //form is valid submit request thru ajax
  
          jQuery.ajax({
              /*more options here*/
  
              success: function (data) {
  
                  /*
                   Server process request and finds that, email is already in use
                   and inventory number is invalid
                   so it sends data in some format may pe JSon
                   with field names and message indicating errors
                   eg: Email:"Already in use"
                   InventoryNo: "Invalid Inventory No",
                   Now can i invalidate these two fields on form mannualy
                   and display the message received from server for each field
                  */
              }
          });
      }
  });
  </code></pre>