Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8867389
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T17:01:05+00:00 2026-06-14T17:01:05+00:00

I have two checkbox lists, i want to get the count of checked elements

  • 0

I have two checkbox lists, i want to get the count of checked elements of these. below is my code:

<div id="divAreaListingByLocation">
  <asp:CheckBoxList ID="chklstArea" CssClass="chkarea" RepeatColumns="6" RepeatDirection="Vertical"
        runat="server" OnSelectedIndexChanged="chklstArea_SelectedIndexChanged" AutoPostBack="true">
  </asp:CheckBoxList>
</div>
<asp:Repeater ID="repRooms" runat="server" OnItemDataBound="repRooms_ItemDataBound">
    <ItemTemplate>
        <div style="height: 100%; float: none;">
            <asp:Panel ID="pnlRoomheader" runat="server" Style="width: 98%; background-color: #86ADD6;
                color: #4A4A4A; height: 20px; margin-top: 10px; text-align: left; padding: 5px;
                font-size: 15px; font-weight: bold;">
                <asp:Label ID="lblAreaName" runat="server"></asp:Label>
                <asp:Label ID="lblAreaId" Style="display: none;" runat="server"></asp:Label>
            </asp:Panel>
            <div id="divRoomListingByLocation" style="padding-bottom: 10px; padding-top: 10px;">
                <asp:CheckBoxList ID="chkRoomList" CssClass="chkRooms" RepeatColumns="6" RepeatDirection="Vertical"
                    runat="server">
                </asp:CheckBoxList>
                <asp:Label ID="lblRoomMessage" Text="This Area does not have any room." ForeColor="Red"
                    runat="server"></asp:Label>
            </div>
        </div>
    </ItemTemplate>
</asp:Repeater>

What i want to do is: if user not checked any of the check box from these two then it will prompt a alert to say check one of the checkbox from both lists on the click of a button.

I have tried to it with class but the class is append to the table render in html of checkboxlist.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T17:01:06+00:00Added an answer on June 14, 2026 at 5:01 pm

    Since you are using checkbox list it will apply the specified class to the Table not the checkbox. There you will have to use

    $(".chkarea").find("input:checked").length;
    

    This will return the count of all the checkboxes that are checked for a checkboxlist with class “chkarea”

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have trouble trying to use any of these two elements for different
I have a jTable with two columns.First column is set as Boolean(for checkbox) and
I have simple issue setting a two-way databinding of a checkbox in Silverlight 3.0.
I have two update panels on a page. And I want to update both
I have a ul list inside a div with li elements and inside the
I have a list of input elements and using one selector I want to
I have asp:datalist binding from table this table contain two columns one of them
So my problem goes like this, I have two lists LIST A contains. Item
I want to get the selected Indices or Items only in checkBox lsit instead
hi i have two xml file and i want to bind grid view eith

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.