title: Multiple input fields Validation with AJAX / PHP on Mysql
body: <p>i've created a form with several fields, input, select, box etc.
  i've 2 fields that must be validated agaist DB. If exists show some details if not display some aditional input fields to add to DB.</p>
  
  <p>Ex: Make, model, licenseplate. 
  IF licenseplate exists -> Honda Accord
  IF NOT -> input to add .</p>
  
  <pre><code>$(document).ready(function(){
    $("licplate").change(function(){
      var lp = $("licplate").val();
  if(lp.length &lt;= 8) { //my country have a 8 digit plate
  $("#stat").html('&lt;image&gt; Verifing');
  $.ajax({
  type: "POST",
  url: "check.php",
  data: "licplate="+lp,
  success: function(msg) {
  $("#stat"),ajaxComplete(function(event,request,settings){
   if(msg=='OK'){
     $(this).html('message to ignore');
  } else { 
  $(this).html(msg); 
  }
  </code></pre>
  
  <p>In my check.php i connect to db, validate and return data. If exist return</p>
  
  <pre><code>echo "&lt;span class="msg"&gt;$row_sql_chk['make']." - ".$row_sql_chk['model']&lt;/span&gt;";
  </code></pre>
  
  <p>if not</p>
  
  <pre><code>&lt;li&gt;&lt;label&gt;Make&lt;/label&gt;&lt;input id="make" name="make" type="text" /&gt;
  &lt;li&gt;&lt;label&gt;Modele&lt;/label&gt;&lt;input id="model" name="model" type="text" /&gt;
  </code></pre>
  
  <p>It work just fine, however i've got a new validation to make in another input field on form.
  I must validate the driver the same way.. is exits the "driverlicense" show name and address if not include fields to insert it.
  I did the same code, change fieldnames, the div name etc.. 
  And work just fine.</p>
  
  <p>But then came the problem... if both of the fields dont exist.
  I fill the fields (make, model) and when validating the driver, if not exist it clears the top fields. After that if i fill (again) all the fields (make, model, name..) works just as expected.
  So how can i do the 2nd field validation without cleaning the other?
  tks</p>