title: Get Checked RadioButtons using JavaScript
body: <p>so I’m trying to build a win 8 app, which includes a WebView. The WebView contains the HTML code (+JavaScript) below.</p>
  
  <pre><code>&lt;!DOCTYPE HTML PUBLIC " -//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;?xml version='1.0' encoding='UTF-8' standalone='yes'?&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv='Content-Type' content='text/html; charset=utf-8' &gt;
  
  &lt;script type='text/javascript'&gt;
  function get_radio_value()
  {
    for (var i=0; i &lt; document.myForm.frage1.length; i++)
    {
      if (document.orderform.frage1[i].checked)
      {
            var rad_val = document.myForm.frage1[i].value;
            return rad_val;
      }
    }
  }
  &lt;/script&gt;
  
      &lt;title&gt;Kundenfragebogen&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
    &lt;h1&gt;Kundenfragebogen&lt;/h1&gt;
  &lt;div id='myDiv'&gt;Hello&lt;/div&gt;
  &lt;form name='myForm' action=''&gt;
  &lt;table border='2'&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;/td&gt;
      &lt;td&gt;sehr gut&lt;/td&gt;
      &lt;td&gt;gut&lt;/td&gt;
      &lt;td&gt;schlecht&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Wie geht es Ihnen?&lt;/td&gt;
      &lt;td&gt;&lt;input type='radio' name="frage1" value='1'/&gt;Mir ging es noch nie besser!&lt;/td&gt;
      &lt;td&gt;&lt;input type='radio' name="frage1" value='2'/&gt;Es geht mir so wie immer.&lt;/td&gt;
      &lt;td&gt;&lt;input type='radio' name="frage1" value='3'/&gt;Heute geht einfach gar nichts…&lt;/td&gt;
    &lt;/tr&gt;
     &lt;tr&gt;
      &lt;td&gt;Können Sie Auto fahren?&lt;/td&gt;
      &lt;td&gt;&lt;input type='radio' name="frage2" value='1'/&gt;Ja&lt;/td&gt;
      &lt;td&gt;&lt;/td&gt;
      &lt;td&gt;&lt;input type='radio' name="frage2" value='3'/&gt;Nein&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Möchten Sie unseren Newsletter abonnieren?&lt;/td&gt;
      &lt;td&gt;&lt;input type='radio' name="frage3" value='1'/&gt;Ja&lt;/td&gt;
      &lt;td&gt;&lt;/td&gt;
      &lt;td&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;
  
  &lt;input type='button' value='Formular absenden' onclick="return get_radio_value()"/&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>So the html contains some radio buttons and a button. I’ve used JavaScript ~2 years ago (just a little), so I don’t really know how to write the exact code. I’ve found something on the internet, but it doesn’t do what I want. I want to have the following:</p>
  
  <p>The user can check the RadioButtons. When the user clicks the Button, the JavaScript function should return all the checked radio buttons (I only need to know which RadioButton is checked).
  Since I know the name of the RadioButtons in my Windows 8 App, I can do the following:</p>
  
  <pre><code>var object = WebView.InvokeScript("JavaScriptFunctionNAME", NameOfRadiobutton);
  </code></pre>
  
  <p>So the WebView invokes the script and should get as a return the VALUE of the RadioButton, which is checked. </p>
  
  <p>“JavaScriptFunctionNAME” = name of the function in Javascript</p>
  
  <p>NameOfRadiobutton = the name of the RadioButton as a parameter (for example “frage1”).</p>
  
  <p>Currently I’m returning the value of the radiobutton, which is checked in the RadioGroup “frage1”. How can I check every RadioButton by it’s parameter? By this I mean I have a parameter “frage1” and return the value of the checked RadioButton. After this, I call the function again with the parameter “frage2” and return the checked RadioButtons value. Could anyone help me out with the JavaScript-function?</p>