title: Radio Button link to URL on Submit
body: <p>Hi this question has been asked before but the answer did not work for me. I have two radio buttons which, on submit, should direct the user to the corresponding URL, but the code I have only directs the user to the homepage, not the sub url.</p>
  
  <p>Heres the code:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
     function doSubmit(form) {
     var urls = form['url'];
     var i = urls &amp;&amp; urls.length;
     while (i--) {
     if (urls[i].checked) {
     window.location = urls[i].value;
  
    }
  }
  return false;
  }
  &lt;/script&gt;
  
  &lt;moduleholder&gt;
  &lt;module align="left" customid="0" width="auto" moduletype="ArtBox" moduleview="0"&gt;
  &lt;content hideifempty="True"&gt;&lt;/content&gt;
  &lt;content hideifempty="False"&gt;
  &lt;module align="left" customid="0" width="auto" moduletype="Form" moduleview="0"       height="auto" usestandardstyles="True"&gt;
    &lt;form onsubmit="return doSubmit(this)" action=""&gt;
      &lt;input name="url" type="radio" value="http://www.google.com"&gt; Google &lt;input name="url" type="radio" value="http://www.yahoo.com"&gt; Yahoo &lt;input type="submit" value="Submit"&gt;
    &lt;/form&gt;
  &lt;/module&gt;
  &lt;/moduleholder&gt;
  </code></pre>