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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T09:38:22+00:00 2026-05-24T09:38:22+00:00

The checkAll click function works, however, the uncheckAll click function does not. Anybody see

  • 0

The checkAll click function works, however, the uncheckAll click function does not. Anybody see what is preventing it from unchecking all the checkboxes that are checked.

$('#checkAll').click(function (e) {
    e.preventDefault();
    $('#dataTablePageList :checkbox').attr('checked','checked');
    $(this).removeAttr('id').attr('id','uncheckAll');
    $(this).find('strong').html('Uncheck All Checkboxes');
});

$('#uncheckAll').click(function (e) {
    e.preventDefault();
    $('#dataTablePageList :checkbox').removeAttr("checked");
    $(this).removeAttr('id').attr('id','checkAll');
    $(this).find('strong').html('Check All Checkboxes');
});

EDIT:

I tried this however for some reason it doesn’t do anything. Not sure why.

$('#dataTablePageList').delegate('#checkAll', 'click', function(e) {
    e.preventDefault();
    $('#dataTablePageList :checkbox').attr('checked',true);
    $(this).removeAttr('id').attr('id','uncheckAll');
    $(this).find('strong').html('Uncheck All Checkboxes');
});

$('#dataTablePageList').delegate('#uncheckAll', 'click', function(e) {
    e.preventDefault();
    $('#dataTablePageList :checkbox').attr('checked',false);
    $(this).removeAttr('id').attr('id','checkAll');
    $(this).find('strong').html('Check All Checkboxes');
});

Edit 3:

$('#viewAll').live('click', function(e) {
    e.preventDefault();
    oTable.fnLengthChange(-1);
    $(this).removeClass('viewAll').addClass('paginateRecords');
    $(this).find('strong').html('View Paginated Records');
    $('.pagination').hide();
}); 

$('#paginateRecords').live('click', function(e) {
    e.preventDefault();
    oTable.fnLengthChange(10);
    $(this).removeClass('paginateRecords').addClass('viewAll');
    $(this).find('strong').html('View All Records'); 
    $('.pagination').show();          
});
  • 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-24T09:38:23+00:00Added an answer on May 24, 2026 at 9:38 am

    event click is binded to DOM element, not every css-match now-or-in-future, so on the first run, only #checkAll would be binded, and latter would not be used at all

    try another way – by using toggle on check element

    $('#checkAll').toggle(function (e) {
        e.preventDefault();
        $('#dataTablePageList :checkbox').prop('checked',true);
        $(this).find('strong').html('Uncheck All Checkboxes');
    },function (e) {
        e.preventDefault();
        $('#dataTablePageList :checkbox').prop('checked',false);
        $(this).find('strong').html('Check All Checkboxes');
    });
    

    as for edit3:

    $('#viewAll').toggle(function(e) {
        e.preventDefault();
        oTable.fnLengthChange(-1);
        $(this).find('strong').html('View Paginated Records');
        $('.pagination').hide();
    }, function(e) {
        e.preventDefault();
        oTable.fnLengthChange(10);
        $(this).find('strong').html('View All Records'); 
        $('.pagination').show();          
    });
    

    toggle() take as parameters two functions which are run alternately after subsequent clicks

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

Sidebar

Related Questions

I am trying to get all checkboxes checked with: <script type=text/javascript> $(document).ready(function() { $(#delmsg_all).click(function()
I am having problems getting a function that clicks all search matched checkboxes. The
I have this right now: $('#markAll').live('click', function () { checkAll(true, $('.cbPick')); $('#markAll').text(); $('#markAll').prepend(<strong>Unmark all</strong>);
I have the following function that checks/unchecks all checkboxes on the page by selecting
I am trying to check all the checkboxes on a webform (aspx) page, which
function checkAll(custId){ var id; if(document.getElementById(custId).checked == true){ <%for (CustomerGroup custGroup : customerGroupList) {%> if(custId==<%=custGroup.getCustomerGroupId()%>){
Hi All First of all I don't know Javascript, I got this script from
I get this error on a .click() event in jQuery. I see it in
In button click event how can I check all check boxes in gridview? I
I have a table with checkboxes and I want to do the check all

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.