title: logic change url get to post method jquery
body: <p>I am trying to convert a GET URL to a POST URL in Jquery, I need logical help.</p>
  
  <p>My Code:</p>
  
  <pre><code>//Code need to change
  var url = '/index.php?page=invoice&amp;action=InvoicePrint&amp;from=print&amp;invoiceid='+Invoiceid;
      window.open(url, "_blank");
  
  //My new code:
  var url = '/index.php?page=invoice&amp;action=InvoicePrint&amp;from=print&amp;invoiceid=' + Invoiceid;
              $('&lt;form action="'+url+'" target="_blank"&gt;&lt;/form&gt;').appendTo('body').submit();
  </code></pre>
  
  <ol>
  <li><p>I cant use GET Method because of the no of invoice ID's (Ex: some 1000 Ids like 1,2,3,4,5,6,7) So I am changing to POST Method to post the Id's.</p></li>
  <li><p>I face problem when I submit by appending a form to body. Check my code above "My new code:". The form was posted to </p></li>
  </ol>
  
  <blockquote>
    <p>index.php?</p>
  </blockquote>
  
  <p>But It was to be:</p>
  
  <blockquote>
    <p>index.php?page=invoice&amp;action=InvoicePrint&amp;from=print&amp;invoiceid=1,2,3,4,5,6,7</p>
  </blockquote>
  
  <p>But nothing was appended to the URL. </p>
  
  <p>Yes, I tested with same GET Method. Once the URL post works i will convert o POST Method. Because only "incoiceid" I am trying to post all other GET Method remains same.</p>
  
  <p>Thank you</p>