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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:18:31+00:00 2026-05-28T04:18:31+00:00

I have a table with checkboxes in the first column. I use the jQuery

  • 0

I have a table with checkboxes in the first column. I use the jQuery DataTable plugin display my table.

I made 2 links to select/unselect every checkboxes. Here’s the one to select all :

<a href="" name="CheckAll" onClick="checkAll(document.email_list_form_inviter.getElementsByClassName(\'email_checkbox\'), event)" >Select all</a>

And the javascript :

function checkAll(field, event) {
    event.preventDefault();
    for (i = 0; i < field.length; i++)
        field[i].checked = true ;

    return false;
}

But the datatable enables pagination and my function select only the visible checkboxes, not those of the other pages. How can do to select every checkboxes in my data table?

Solution :

Ok I did this with fnGetNodes, thank you amccausl!

$("a[name='CheckAll']").click(function(event) {
        event.preventDefault();
        var nodes = datatable.fnGetNodes( );
        $('.email_checkbox', nodes).attr("checked", "checked");
    });
  • 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-28T04:18:32+00:00Added an answer on May 28, 2026 at 4:18 am

    You can use fnGetNodes to grab all the nodes you need, instead of the getElementsByClassName.

    You should also be using jquery.click() event instead of defining an onClick yourself

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

Sidebar

Related Questions

I have a table with a select all checkbox as the first header column
I have a table of todos and on the leftmost column are normally checkboxes
I have an HTML table in which the first column's cells each contain a
I have a table inside a form. I'm trying to display a 'select' form
I thought this would be simple I have a table with the first column
I have created an HTML table with two columns. I want the first column
I have a table with 3 columns, the first column is special and contains
I'm currently dynamically building an asp:table which contains checkboxes these checkboxes have a CheckChanged
I have a collection of checkboxes loaded from a table that are loaded in
I have table with 3 columns A B C. I want to select *

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.