title: How to loop through a radio button list
body: <p>I searched online and didn't find a good method to select radiobuttonlist control in .net
  So I add a class to each radiobuttonlist and using class selector to loop each, however, it seems that whenever one changes, all change. See my code as follows:
  This is jQuery part:</p>
  
  <pre><code>function Checkform() {
      result=true;
      $('.rbl').each(function() {
              var cc = $(this + "[checked]").val();
              if (cc == undefined) {
                  result = false;
                  return false;
              }
          });
          return result;
      }
  </code></pre>
  
  <p>This is web part:</p>
  
  <pre><code>&lt;form id="form1" runat="server" onsubmit="return Checkform();"&gt;
  &lt;asp:RadioButtonList ID="RadioButtonList1" class="rbl"  runat="server"&gt;
          &lt;asp:ListItem&gt;1&lt;/asp:ListItem&gt;
          &lt;asp:ListItem&gt;2&lt;/asp:ListItem&gt;
          &lt;asp:ListItem&gt;3&lt;/asp:ListItem&gt;
      &lt;/asp:RadioButtonList&gt;
  
      &lt;asp:RadioButtonList ID="RadioButtonList2" class="rbl" runat="server" 
          RepeatDirection="Horizontal"&gt;
          &lt;asp:ListItem&gt;1&lt;/asp:ListItem&gt;
          &lt;asp:ListItem&gt;2&lt;/asp:ListItem&gt;
          &lt;asp:ListItem&gt;3&lt;/asp:ListItem&gt;
          &lt;asp:ListItem&gt;4&lt;/asp:ListItem&gt;
      &lt;/asp:RadioButtonList&gt;
  </code></pre>
  
  <p></p>
  
  <p>What I want to do is to check if all radiobuttonlist control has its selected value before submitting the form. But it works like as one has selected value, the function will return true no matter weather the other one has selected value. Please help me on this issue. Thank you in advance.</p>