title: Post form with Ajax and jQuery
body: <p>Start learning Ajax (and jQuery), I encounter the issue with post form data, which I could not resolve myself.</p>
  
  <p>First, here is the simple example where I collect data, post it, and displayed it on a new page:</p>
  
  <pre><code>&lt;!-- index.html --&gt;
  &lt;form id="myForm" action="test.php" method="post"&gt; 
  &lt;input type="checkbox" id="ch1" name="Ch1" value="1"&gt;Check Box 1 &lt;br /&gt;
  &lt;input type="checkbox" id="ch2" name="Ch2" value="2"&gt;Check Box 2 &lt;br /&gt;
  &lt;input type="submit" id="myButton" /&gt;
  &lt;/form&gt;
  
  &lt;?php
  // test.php
  print_r($_POST);
  ?&gt;
  </code></pre>
  
  <p>Then I tried with Ajax and jQuery. I slightly modified the form pasted above:</p>
  
  <pre><code>&lt;!-- index.html --&gt;
  &lt;form id="myForm"&gt; 
  &lt;input type="checkbox" id="ch1" name="Ch1" value="1"&gt;Check Box 1 &lt;br /&gt;
  &lt;input type="checkbox" id="ch2" name="Ch2" value="2"&gt;Check Box 2 &lt;br /&gt;
  &lt;input type="button" id="myButton" value="Submit"/&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>And here is the jQuery function:</p>
  
  <pre><code>// script.js
  
  $(document).ready(function () {
      $("#myButton").click(function () {
          $.ajax({
              cache: false,
              type: 'POST',
              url: 'test.php',
              data: $("#myForm").serialize()
          });
      });
  });
  </code></pre>
  
  <p>My question is, how to reimplement the jQuery function to echo the result in the <code>test.php</code> tab? I crawled the many resources, but i didn't find any solution.</p>
  
  <p>Thanks in advance for any pointer.</p>
  
  <p>Best, Andrej</p>