Client-side RadioButtonList validation
<pre><code> function IsChecked()
     {
    var rblActive = document.getElementById("&lt;%=rblActive.ClientID %&gt;");
    var item = rblActive.getElementsByTagName("input");
    var IsItemChecked = false;
    for (var i = 0; i &lt; item.Length; i++)
     {
        if (item[i].checked) 
        {
        IsItemChecked = true;
        }

      }
        if (IsItemChecked == false) 
          {
          alert("Check Yes or No");
          rblActive.focus();
          return false;
           }
          return true;
      }
</code></pre>

<p>This is the code I tried. When control comes in the for loop, it directly comes out without any action even if the item in the radio button list is checked or not checked.</p>
