title: Posting form values securely from one page to another on client-side using pure Javascript and NO server-side technology
body: <p>I need to POST form values from one page to another using Javascript. </p>
  
  <p>Now, I know that I could use a server-side technology like ASP.Net or PHP to post values but I am not allowed to use any server side script.
  I am aware that using the GET method, I can pass the form values as a query string but the values will not be passed securely (which is an important requirement!)</p>
  
  <p>The conditions listed below:</p>
  
  <ol>
  <li>This code should take the values that are posted to the page and
  repost to target page.  HTTP POST only (not get). </li>
  <li>In no cases, even error, the request should not stop on this bridge page.</li>
  <li>The script needs to handle multiple posted values.</li>
  <li>Try to use standard javascript (no 3rd party library)</li>
  <li>Script needs to work in IE, FF, Safari, most standard browsers</li>
  </ol>
  
  <p>Can anyone please help me find a solution to this or point me to some resource that will help me find the soln? Thanks in advance. Below is the code for passing values as a query string. Can I modify this so that my above requirements are satisfied?</p>
  
  <p>FORM</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;Test&lt;/title&gt;
  &lt;script type="text/javascript"&gt;
  
  function goto_page(page) {
      var usbnum = document.getElementById('usbnum').value;
      var usbcode = document.getElementById('usbcode').value;
      var q_str = '?usbnum=' + usbnum + '&amp;usbcode=' + usbcode;
  
      var url = page + q_str;
  
      window.location = url;
  }
  
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;form id="form1" method="post"&gt;
  &lt;div&gt;
      USB No: &lt;input name="usbnum" id="usbnum" type="text" size="80" /&gt;&lt;br /&gt;
      USB Code: &lt;input name="usbcode" id="usbcode" type="text" size="80"/&gt;
  &lt;/div&gt;
  &lt;a href="#" onclick="goto_page('bridgepage.html');"&gt;Next&lt;/a&gt;
  &lt;/form&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>BRIDGE PAGE</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;Bridge Page&lt;/title&gt;
  
  &lt;script type="text/javascript"&gt;
  function get_params() {
      var url = window.location.href;
      var q_str_part = url.match(/\?(.+)$/)[1];
  
      var val_pairs = q_str_part.split('&amp;');
      var params = {};
  
      for (var i = 0; i &lt; val_pairs.length; i++) {
          var tmp = val_pairs[i].split('=');
          params[tmp[0]] = typeof tmp[1] != 'undefined' ? tmp[1] : '';
      }
  
      return params;
  }
  
  function write_params() {
      var params = get_params();
  
      var txt = 'Hello ';
  
      for (var i in params) {
          txt += params[i] + ' ';
      }
  
      var body = document.getElementsByTagName('body')[0];
      body.innerHTML += txt;
  }
  
  function write_params() {
    var params = get_params();
  
    var num_container = document.getElementById('usbnum');
    var code_container = document.getElementById('usbcode');
  
    num_container.innerHTML = params.usbnum;
    code_container.innerHTML = params.usbcode;
  }
  &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body onLoad="write_params()"&gt;
  
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>