title: jQuery - Send a form asynchronously
body: <p>I have a form such as :</p>
  
  <pre><code>&lt;form action='???' method='post' name='contact'&gt;
          &lt;input type="text" class="inputContact" name="mittente" /&gt;
          &lt;textarea class="textContact" name="smex"&gt;&lt;/textarea&gt;
          &lt;input type="submit" value="Send" /&gt;
      &lt;/div&gt;
  &lt;/form&gt; 
  </code></pre>
  
  <p>I'd like to send these data asynchronously, trought jQuery function <code>$.ajax</code>.</p>
  
  <p><strong>EDIT :with solution :</strong></p>
  
  <pre><code>&lt;form name='contactForm'&gt;
      &lt;input type="text" class="inputContact" name="mittente" /&gt;
      &lt;textarea class="textContact" name="smex"&gt;&lt;/textarea&gt;
      &lt;input type="submit" value="Send" /&gt;
  &lt;/form&gt; 
  
  &lt;script type="text/javascript"&gt;
  $(document).ready(function() {
      $('form[name=contactForm]').submit(function(e){
          e.preventDefault();
          $.ajax({
              type: 'POST',
              cache: false,
              url: './ajax/header_ajax.php',
              data: 'id=header_contact_send&amp;'+$(this).serialize(), 
              success: function(msg) {
                  $("#boxContentId").html(msg);
              }
          });
      });     
  });         
  &lt;/script&gt;
  </code></pre>