title: How to pass form data using POST method and JS submit()?
body: <p>How to pass form data using POST method and JS submit() ?</p>
  
  <p>I would like not to use AJAX.</p>
  
  <p>I can achieve that by using JS and GET method, but my goal now is to use JS (probably with submit() ) and POST method.</p>
  
  <p>Please give a simple working example.</p>
  
  <p>Thank you!</p>
  
  <p>Edited: Sorry, I will be more specific.
  Here is a simple code I have:</p>
  
  <pre><code>&lt;form name=\"myform\" action=\"\"&gt;
    Search: &lt;input type='text' name='query' /&gt;
    &lt;a href=\"javascript: submitform()\"&gt;Search&lt;/a&gt;
  &lt;/form&gt;
  
   &lt;script type=\"text/javascript\"&gt;
   function submitform() {   document.myform.submit(); }
   &lt;/script&gt;
  </code></pre>
  
  <p>When I insert "word" into the input field and press Search, the URL becomes "../index.php?query=word" and that means that form data is passed like GET method.</p>
  
  <p>And my goal is to remove any form data from URL and pass it like with POST method.</p>
  
  <p>Edited: ohh.. I just added method=post and no form data in the URL anymore :)</p>