title: Submit form with parameter through Javascript
body: <p>Below is my Javascript code where k and m are Javascript variables.</p>
  
  <pre><code>function javascriptfunction() {
    document.forms[formname].action="gotopage.php?parameter1="+k+"&amp;parameter2="+m;
    document.forms[formname].submit();
  }
  </code></pre>
  
  <p>The above code executes correctly when my HTML form has a POST method. Below is my HTML page:</p>
  
  <pre><code>&lt;form name="formname" action=# method=POST&gt;
    &lt;input type=text name="data1" value="one"&gt;
    &lt;input type=text name="data1" value="two"&gt;
    &lt;input type=button name="button1" value="send" onclick="javascritfunction();"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>But when I give a GET method in my HTML form, then the HTML form data is submitted i.e</p>
  
  <pre><code>gotopage.php?data1=one&amp;data2=two is submitting not Javascript action value i.e
  gotopage.php?parameter1="+k+"&amp;parameter2="+m
  </code></pre>
  
  <p>So how to submit the form with Javascript parameter when the method is GET in the HTML form?</p>