title: how to get selected radio button from radiobuttonlist in javascript
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/579597/how-can-i-determine-the-selectedvalue-of-a-radiobuttonlist-in-javascript">How can I determine the SelectedValue of a RadioButtonList in JavaScript?</a>  </p>
  </blockquote>
  
  
  
  <p>i want to get selected radio button from asp.net radiobuttonlist in javascript. In textbox onchange event i wrote codes below; </p>
  
  <pre><code>&lt;asp:RadioButtonList CssClass="radioWithProperWrap"
                    ID="RadioButtonList1" runat="server" CellPadding="0" 
              CellSpacing="0" RepeatColumns="2" RepeatDirection="Horizontal" 
                    &gt;
              &lt;asp:ListItem Value="1" Selected="True"&gt;Aylık Ödeyeceğim Taksite Göre&lt;/asp:ListItem&gt;
              &lt;asp:ListItem Value="2"&gt;Toplam Alacağım Krediye Göre&lt;/asp:ListItem&gt;
              &lt;/asp:RadioButtonList&gt;
  &lt;asp:TextBox ID="TempTxtBox" runat="server" onchange="myFun()" &gt;&lt;/asp:TextBox&gt; 
  </code></pre>
  
  <p>And the javascript;</p>
  
  <pre><code>&lt;script language="javascript" type="text/javascript"&gt;
  
      function myFun() {
  
  
          var deger = document.getElementById('&lt;%=TempTxtBox.ClientID%&gt;').value;
          var vade  = document.getElementById('&lt;%=MaturitytxtBox.ClientID%&gt;').value;
  
  
          var radioButtons = document.getElementsByName('&lt;%=RadioButtonList1.ClientID%&gt;');
  
          var radio = radioButtons.item(0).checked;
  
          alert(radio);
  
      }
  
  &lt;/script&gt;
  </code></pre>
  
  <p>It is not working..Anyone can help?</p>