title: How can I send a variable to a form using this javascript function?
body: <p>I've got this onclick call:</p>
  
  <pre><code>onClick="mySubmit();
  </code></pre>
  
  <p>which calls this function:</p>
  
  <pre><code>function mySubmit(){
      document.getElementById("myForm").submit();
  }
  </code></pre>
  
  <p>which then submits this form:</p>
  
  <pre><code>&lt;form id="myForm" action="action.php" method="post"&gt;
  </code></pre>
  
  <p><strong>My question is:</strong> how do I send a variable to the form from the onClick to get something like <code>&lt;form id="myForm" action="action.php?id=**(the variable sent from the onclick goes here)**" method="post"&gt;</code></p>
  
  <p>Thanks!</p>