title: how to stop submit button while response thrown an error (php error)
body: <p>My AJAX code is bellow </p>
  
  <pre><code>$("#step_3 :submit").click(function(event) {
          event.preventDefault();
  
  
          var formData = $("#dbConfigID").serialize();
  
          $.ajax({
  
              url: "../pard_config/dbconfig.php",
              type: "POST",
              data: formData,
              beforeSend:function(){
  
              },
  
              success: function(responce) {
              $("#res").show().html(responce);
  
  
              }
  
          });
  
      });
  </code></pre>
  
  <p>PHP CODE (only the catch )</p>
  
  <pre><code> catch (Exception $e) {
          echo 'Warnning: ',  $e-&gt;getMessage(), "\n";
      }
  </code></pre>
  
  <p>if my database credentials  are wrong, it still show the 200 success code in the firebug.And my submit button is being triggering while php ajax response is an error like bellow </p>
  
  <pre><code>Warnning: SQLSTATE[HY000] [2005] Unknown MySQL server host 'localhosts' (1)
  </code></pre>
  
  <p>How to stop the button triggering while it was an error like above ?</p>