title: after clicking a link, on the next page some radiobutton is checked
body: <p>I'm looking for a solution for my problem,
  There are 3 links on a page, when clicking on one of the links there loads a new page. 
  On that new page there are 3 checkboxes. </p>
  
  <p>When clicking on link 1 of the first page the radiobutton 1 on the new page needs to be checked, link 2 -> checkbox 2, etc.</p>
  
  <p>I think there are 3 options to do this, with sessionStorage, cookies or use some URL ?var. 
  Seems I can't use php into the form.</p>
  
  <p>How can I get this to work, don't care much how it's done.
  Any help really appreciated!</p>
  
  <h3>edit this is solved</h3>
  
  <pre><code>&lt;input type="radio" name="amount" value="1" /&gt; 1 &lt;br&gt;
  &lt;input type="radio" name="amount" value="2" /&gt; 2 &lt;br&gt;
  &lt;input type="radio" name="amount" value="3" /&gt; 3 &lt;br&gt;
  
  
  &lt;script&gt;
  function getQueryVariable(variable) {
      var query = window.location.search.substring(1);
      var vars = query.split('&amp;');
      for (var i = 0; i &lt; vars.length; i++) {
          var pair = vars[i].split('=');
          if (decodeURIComponent(pair[0]) == variable) {
              return decodeURIComponent(pair[1]);
          }
      }
      }
  
  
  var am=getQueryVariable("amount");
  var allElems = document.getElementsByName('amount');
  for (i = 0; i &lt; allElems.length; i++) {
      if (allElems[i].type == 'radio' &amp;&amp; allElems[i].value ==am ) {
          allElems[i].checked = true;
      }
  }
  &lt;/script&gt;
  </code></pre>