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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T06:33:27+00:00 2026-06-11T06:33:27+00:00

Currently I have two tables I have select-all functions on the top left checkboxes,

  • 0

Currently I have two tables

I have select-all functions on the top left checkboxes, but clicking on one select-all highlights all checkboxes in BOTH tables, whereas I only want all boxes to be selected in the specific ‘check-all’ clicked.

Also, when I do select all and click one of the directional buttons < or >, it drags all the rows fine but drags the headers with it as shown here:

My JQuery is quite simple at the moment but I’m obviously missing out on something –

 $('#select-all').click(function (event) {
        if (this.checked) {
            // Iterate each checkbox
            $(':checkbox').each(function () {
                this.checked = true;
            });
        }
        else
        // Iterate each checkbox
            $(':checkbox').each(function () {
                this.checked = false;
            });
    });

Where ‘select-all’ is the id of the select-all checkbox in the ‘tarifs de quittancement’.

Any help is appreciated

EDIT

My JQuery for the > button code is as follows :

   $("#move-to-1").on("click", function () {
        var selected = $("#table2").find("input:checked");

        selected.each(function (idx, elem) {
            $(elem).closest("tr").detach().appendTo($("#table1 tbody"));
        });
    });

This works fine to move all from one table to the other, but I don’t want the row containing the select-all checkbox/table headers to move with the rest of the row data. How can this be done?

Thanks again.

Further Edit

Now it’s all sorted, except for a small bug where selecting one checkbox row (not select-all) and moving it < or > results in ALL rows being moved.

JQuery in use:

   $('#move-to-1').on('click', function () {
        var selected = $('#table2').find('input:checked');
        selected.each(function (idx, elem) {
            $(elem).closest('tbody').find('tr').detach().appendTo($("#table1 tbody"));
            $('input[type=checkbox]').attr('checked', false);
        });
    });   

   $('#select-all').click(function (event) {
    $(this).closest('table').find(':checkbox').prop('checked', this.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-06-11T06:33:29+00:00Added an answer on June 11, 2026 at 6:33 am

    You only need to modify the checkboxes inside the current table. Since you haven’t shown your markup it is extremely hard to guess how the proper selector might look or whether you are using tables at all but try like this:

    $('#select-all').click(function (event) {
        $(this).closest('table').find(':checkbox').prop('checked', this.checked);
    });
    

    UPDATE:

    To address your second question, assuming you have separated the headers from the body inside those tables using the <thead> and <tbody> sections which is the correct way, you could adapt your selector:

    $('#move-to-1').on('click', function () {
        var selected = $('#table2 tbody').find('input:checked');
        selected.each(function (idx, elem) {
            $(elem).closest('tr').detach().appendTo($("#table1 tbody"));
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two tables. One that keeps all of my threads started on a
I currently have two tables, one for pages (objects) and one for images (media).
The database I am working with currently does have two tables, one holding the
I currently have two tables, one is called games, the other called rounds. Here
I currently have two SQL commands. One retrieves a list of unique IDs from
I currently have two panels within another large panel. The left panel is for
I (currently) have two forms, one that needs to call the other. In other
I have two tables, one for values one for location and am trying to
I have two tables. One contains information on hotels, added to my website by
I have two tables. One contains information on hotels, added to my website by

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.