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

  • Home
  • SEARCH
  • 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 9236247
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:14:45+00:00 2026-06-18T07:14:45+00:00

I have got a problem. I have some checkbox. I want to select them

  • 0

I have got a problem. I have some checkbox. I want to select them at once, but counting result is wrong. when If I use firefox, opera then ok but when i use crome,safari, IE then It gives me a wrong result. why? please help me.

http://jsfiddle.net/Taslimkhan/kdEmH/2/

some code I have set here:

    // add multiple select / deselect functionality
    $("#selectall").click(function () {
          $('.case').attr('checked', this.checked);
    });

    // if all checkbox are selected, check the selectall checkbox
    // and viceversa
    $(".case").click(function(){

        if($(".case").length == $(".case:checked").length) {
            $("#selectall").attr("checked", "checked");
        } else {
            $("#selectall").removeAttr("checked");
        }

    });
});
      $(document).ready(function () {
        $("input[type=checkbox]").each(function () {
          $(this).change(updateCount);
        });

        updateCount();

        function updateCount () {
          var count = $("input[type=checkbox]:checked").size();

          $("#count").text(count);
          $("#status").toggle(count > 0);
        };
      });
  • 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-18T07:14:47+00:00Added an answer on June 18, 2026 at 7:14 am

    First, .size() is deprecated. Use the length property instead.

    Second, you probably want to restrict the checkboxes being counted to the ones with the .case class:

    var count = $("input[type=checkbox].case:checked").length;
    

    Third, the way your code is written, you should be calling updateCount() on the click event instead of the change event, and you don’t need the anonymous function there:

    $("input[type=checkbox]").click(updateCount);
    

    I saved a new revision of your jsfiddle: http://jsfiddle.net/kdEmH/8/

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

Sidebar

Related Questions

I'm getting crazy with this problem: I have got some Oracle SQL-Reports to redesign
I have some problem with Jquery Autocomplete plugin ( http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/ ) I got it
I got some problems in Datagrid WPF I have a datagrid, and I want
I have got some problem implementing bullet physics into my opengl game. The thing
I have got a problem with the zend navigation. I use the zend navigation,
I've got some problem in making a search using checkbox. Basically, I've got some
I have some problem to get the Google Analytics to work. I have got
I have got a serious problem running our web app in some machines.. machines
I have got problem while inserting some data in polish language(characters like ąćęłóżź) into
I got problem with some special characters. I have defined the meta tag as

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.