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 6641965
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:52:27+00:00 2026-05-25T23:52:27+00:00

i am using asp.net c# jquery vs 2008 I have two check box list

  • 0

i am using asp.net c# jquery vs 2008

I have two check box list (cbList,checkboxList1) and one check box (chkALL).
when i checked the check box(chkALL),it should check all checkboxes in Check box list(CbList)

I am using the following code in jquery.It is not working properly.It checks both checkbox list.I need to check only one checkboxlist. Any help appreciated

<script type="text/javascript" src="jquery-1.6.4.js"></script>

 <script type="text/javascript">


               function jqCheckAll2(id, name) {

                   $("INPUT[@Name=" + name + "][type='checkbox']").attr('checked', $('#' + id).is(':checked'));

               }






       </script>


    <form id="form1" runat="server">
    <div>

      <asp:CheckBox ID="chkAll" runat="server" Text="Check All" onclick="jqCheckAll2( this.id, 'cbList' )"/><br />


    <asp:CheckBoxList ID="cbList" runat="server">
</asp:CheckBoxList>
    <asp:CheckBoxList ID="CheckBoxList1" runat="server">
</asp:CheckBoxList>
    </div>
    </form>
  • 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-05-25T23:52:27+00:00Added an answer on May 25, 2026 at 11:52 pm

    I can not see exactly what is causing your problem, but what I can see is that you are using cbList as the name which is a server side name. Instead you should use cbList.ClientID which is a unique client side name for the control. In other words add the onclick event side like this:

    chkAll.Attributes["onclick"] = string.Format("jqCheckAll2(this.id, '{0}')", cbList.ClientID);
    

    then change jqCheckAll2 to this:

           function jqCheckAll2(id, name) {
               $("#" + name).find(":checkbox").attr('checked', $('#' + id).is(':checked'));
           }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have been building websites using vs 2008 (mostly asp.net mvc, jquery and webforms).
I have build a webapplication using ASP.NET MVC and JQuery. On my local machine
Using Asp.net and jQuery I have a GridView with a CheckBox column. Right now
I am using asp.net mvc with jquery... I have made a json call to
I am using ASP.NET MVC with jQuery. I have the following MVC Action that
I'm using ASP.NET Ajax with JQuery. I have a click event that adds/removes css
I am using ASP.NET MVC and jQuery. I have this code in my js
I have to build a registration form using asp.net mvc 3 jquery validate. That
I'm developing an web application using asp.net MVC and jQuery. I have in my
I am using ASP.Net and jQuery/jQuery UI and I am trying to use the

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.