title: Submit a form from a link and get $_Post value
body: <p>I have the following problem. I have a form containing several  links.
  Those  links should assign a hidden field and submit the form using some javascript. </p>
  
  <p>I'm using PHP 5.4. </p>
  
  <p>When I submit the form using the button, the $_POST containts data. But when the form is submitter from javascript, the $_POST is empty.</p>
  
  <p>Any clue?</p>
  
  <pre><code>&lt;head&gt;
     &lt;script language="text/javascript"&gt;
      function affect(numMet)
      {
          document.forms['frmDemo'].num_met_choose.value = numMet;
          document.forms['frmDemo'].submit();
      }
      &lt;/script&gt;
   &lt;/head&gt;
   &lt;body&gt;
  
   &lt;?php
     var_dump($_POST);
    ?&gt;
  
   &lt;form name="frmDemo" enctype="multipart/form-data" method="POST"&gt;
     &lt;input  name="num_met_choose" id="num_met_choose"&gt;
     &lt;a href="" onClick="javascript:affect('22');" &gt;test 1&lt;/a&gt;
     &lt;a href="" onClick="javascript:affect('12');" &gt;test 2&lt;/a&gt;
     &lt;button id="submit" type="submit"&gt;OK&lt;/button&gt;
   &lt;/form&gt;
  </code></pre>
  
  <p></p>