title: Submit 2 forms with one button in Javascript does not work
body: <p>I want to submit 2 forms from the same page with one button, so I tried to use the Javascript technic described in <a href="https://stackoverflow.com/questions/7843355/submit-two-forms-with-one-button">this</a> post.</p>
  
  <p>Here is my code:</p>
  
  <p><strong>send.php:</strong></p>
  
  <pre><code>&lt;form action="receive.php" method="post" id="form1"&gt;
      &lt;input type="text" value="2nd Form" name="q1" /&gt;
  &lt;/form&gt;
  &lt;form action="receive.php" method="post" id="form2"&gt;
      &lt;input type="text" value="3rd Form" name="q2" /&gt;
  &lt;/form&gt;
  
  
  &lt;input type="button" value="Click Me!" onclick="submitForms()" /&gt;
  
  &lt;script&gt;
  
  submitForms = function(){
      document.getElementById("form1").submit();
      document.getElementById("form2").submit();
  }
  
  &lt;/script&gt;
  </code></pre>
  
  <p><strong>receive.php:</strong></p>
  
  <pre><code>echo $_POST['q1'];
  
  echo $_POST['q2'];
  </code></pre>
  
  <p>But when it redirects to <strong>receive.php</strong> only the value of <code>$_POST['q2']</code> appears, and not the value from the 1st input. </p>
  
  <p>I can't see why is it so. Thank you.</p>