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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:21:02+00:00 2026-06-10T05:21:02+00:00

I have a web page which has 6 checkboxes on it. <input type=checkbox name=chk1

  • 0

I have a web page which has 6 checkboxes on it.

<input type="checkbox" name="chk1" id="chk1" class="chkbox"/>
<input type="checkbox" name="chk2" id="chk2" class="chkbox"/>
<input type="checkbox" name="chk3" id="chk3" class="chkbox"/>
<input type="checkbox" name="chk4" id="chk4" class="chkbox"/>
<input type="checkbox" name="chk5" id="chk5" class="chkbox"/>
<input type="checkbox" name="chk6" id="chk6" class="chkbox"/>

Using jquery how can I check to see if all of these 6 checkboxes are checked and if all 6 are checked check checkbox number 7:

<input type="checkbox" name="chk7" id="chk7" class="chkbox"/>

I have started to write the function but not sure if this is the best way to do this:

    function AllSectionsChecked {
        var isChecked1 = $('##chk1').attr('checked')?true:false;
        var isChecked2 = $('##chk2').attr('checked')?true:false;
        var isChecked3 = $('##chk3').attr('checked')?true:false;
        var isChecked4 = $('##chk4').attr('checked')?true:false;
        var isChecked5 = $('##chk5').attr('checked')?true:false;    
        var isChecked6 = $('##chk6').attr('checked')?true:false;                    
    }

Any help would be appreciated. I am guessing its pretty much straight forward but just looking for the best way to accomplish this in jquery.

UPDATE:
*The ids and names are created dynaically and may not be in any order or scale so an id maybe chk51 and the next one maybe chk205, Appologies I should have put this in my original post *
Thankyou for your suggestions so far.

many thanks

  • 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-10T05:21:03+00:00Added an answer on June 10, 2026 at 5:21 am

    Assuming the ID of the last checkbox should be chk7 and not chk5 ?

    $('#chk7').prop('checked', $('input[type="checkbox"]:lt(6):checked').length == 6);
    

    DEMONSTRATION

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

Sidebar

Related Questions

I have a user profile page on my web app which has contact information.
I have a ASP.NET web application which has more than 100 pages. Each page
I have a web page which has a form at the top and a
I have a web page which has three <div> elements: Right_bar contains several layouts
Let's assume I have a web page which has some onmouseover javascript behaviour to
I have a website which has a web page containing list of logs. Now
I have one web page MyWebPage.aspx which while loading has to show data from
I have a Web Application which has Global_Asax and a Custom Error Page. When
I have a web-page with content, which has to be generated. However, the generation
I have a web page which allow users to compose news articles. It has

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.