title: Disabled submit button if inputs are empty
body: <p>What I have here is a ajax checking the availability of information in database. But what my problem is I want to disabled the submit button if the others inputs/textboxes are empty. I add the disable function in my ajax but when one of the textbox has a value the disabled isn't working. Any help will appreciate.</p>
  
  <p><strong>Index.php</strong></p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(document).ready(function()
  {
  $('input[type="text"]').change(function() 
  {
  var pr = $("#pr").val();
  var msgbox = $("#status");
  var txtbxs = $('.inputs').val();
  
  $.ajax({
      type: "POST",
      url: "check_ajax.php",
      data: "pr="+pr,
      success: function(msg){
      console.log(msg)
     $("#status").ajaxComplete(function(event, request){
      if(msg == 'OK' &amp;&amp; txtbxs !== '')
      {
          msgbox.html('&lt;img src="css/available.png" align="absmiddle"&gt;');
          $("#save").prop("disabled",false);
      }
      else
      {
      $("#save").prop("disabled",true);
      msgbox.html(msg);
      }
     }); 
     }  
    });
  return false;
  });
  });
  &lt;/script&gt;
  
  &lt;tr&gt;
      &lt;td&gt;PR #&lt;/td&gt;
      &lt;td&gt;&lt;input type="text" name="pr" id="pr" autocomplete="off"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
      &lt;td&gt;&lt;/td&gt;
      &lt;td&gt;&lt;span id="status"&gt;&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
      &lt;td&gt;Date1&lt;/td&gt;
      &lt;td&gt;&lt;input type="text" class="datepicker inputs" autocomplete="off" readonly&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
      &lt;td&gt;Date2&lt;/td&gt;
      &lt;td&gt;&lt;input type="text" class="datepicker inputs" autocomplete="off" readonly&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;input type="button" value="Save" id="save"&gt;
  </code></pre>
  
  <p><strong>Check_ajax.php</strong></p>
  
  <pre><code>&lt;?php
  if(isset($_POST['pr']))
  {
  $pr = $_POST['pr'];
  $sql = $mysqli-&gt;query("select id, pr from pr_list where pr='$pr'");
  if(($sql-&gt;num_rows)&gt;= 1)
  {
  echo '&lt;STRONG&gt;'.$pr.'&lt;/STRONG&gt; is already in use.';
  }
  elseif($pr == '') {
  echo 'Fund is Empty';
  }
  else
  {
  echo 'OK';
  }
  }
  ?&gt;
  </code></pre>