title: jQuery Ajax POST form not posting
body: <p>I have no idea why my form isn't posting and instead just reloads the page.</p>
  
  <p>I can do this with <code>$.ajax({type:GET})</code>. But it just doesn't feel right doing it this way as all my script post data to the database.</p>
  
  <p>I also tried adding <code>$('#status-form').serialize()</code> and <code>'status=' + status_value</code> to <code>$.ajax({data:})</code>. But doesn't work. Just refreshes the page and submits nothing to the database.</p>
  
  <p>Here is my jQuery:</p>
  
  <pre><code>$(document).on('click', '.edit',function() {
      var project_id_value=$(this).closest('tr').find('.project_id').text();
      $('#popup').show();
      $('#popup').load('scripts/form.php');
  
  $(document).on('click',".bttt", function(){
      var status_value=$('#status option:selected').val();
      var formData = $('#status-form').serialize();
      $.ajax({
          type:POST,
          url:'scripts/change-status.php?project_id=' + project_id_value,
          data:formData,
          success: function(data){
              alert(data)},
          });
      });
  return false;
  });
  </code></pre>
  
  <p>form:</p>
  
  <pre><code>&lt;form method="post" id="status-form"&gt;
  &lt;select name="status" id="status"&gt;
      &lt;option value="1"&gt;1&lt;/option&gt;
      &lt;option value="2"&gt;2&lt;/option&gt;
      &lt;option value="3"&gt;3&lt;/option&gt;
      &lt;option value="4"&gt;4&lt;/option&gt;
      &lt;option value="5"&gt;Closed&lt;/option&gt;
  &lt;/select&gt;
  &lt;button class="bttt"&gt;Hello&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>EDIT: </p>
  
  <p>I have fixed the typo mistake. Still have the same problem</p>
  
  <p><strong><em>SOLUTION:</em></strong></p>
  
  <p>I found the solution to this why browser use to refresh and do nothing. Since I'm using firefox and firefox takes any button in a form as a submit button. When I clicked the button it was used to POST the form before reaching to $.ajax({success:}). What I had to do is to give the button a <code>type="button"</code></p>