How to make sure at least one check box is selected
<p>I'm trying to make sure at-least one check-box is selected using custom validator and javascript but but it does not show the error message at all. It blocks the code to go forward but fails to show the error message.  If I select one checkbox then the code move on to the next level.  What am missing here?  thanks.</p>

<pre><code> &lt;script type="text/javascript"&gt;

        function ValidateModuleList(source, args) {
            var chkListModules = document.getElementById('&lt;%= cblCustomerList.ClientID %&gt;');
            var chkListinputs = chkListModules.getElementsByTagName("input");
            for (var i = 0; i &lt; chkListinputs.length; i++) {
                if (chkListinputs[i].checked) {
                    args.IsValid = true;
                    return;
                }
            }
            args.IsValid = false;
        }
    &lt;/script&gt;
</code></pre>

<p>and here is my custom validator and the control</p>

<pre><code> &lt;asp:CheckBoxList ID="cblCustomerList" runat="server" DataSourceID="SqlDataSource1"
     DataTextField="GroupName" DataValueField="GroupName" onclick="readCheckBoxList()"&gt;
 &lt;/asp:CheckBoxList&gt;

 &lt;asp:CustomValidator runat="server" ID="cvmodulelist" ValidateModuleList"
      ErrorMessage="Please Select Atleast one Application" &gt;&lt;/asp:CustomValidator&gt;
</code></pre>
