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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T23:25:44+00:00 2026-06-06T23:25:44+00:00

I having trouble with the following two jquery scripts $(document).ready(function() { var $checkboxes =

  • 0

I having trouble with the following two jquery scripts

$(document).ready(function() {
    var $checkboxes = $("#table_pdf_view input[type=checkbox]");
    $checkboxes.on('change', function() {
        var ids = $checkboxes.filter(':checked').map(function() {
            return this.id;
        }).get().join(',');
        $('#multi_client_id').val(ids);
    });
});
//-->
<!--
$(document).ready(function(){ // 1
    // 2
    $(':checkbox.selectall').on('click', function(){
        // 3
        $(':checkbox[name=' + $(this).data('checkbox-name') + ']').prop("checked", $(this).prop("checked"));

    });

});

Both work perfectly by themselves. The first goes through #table_pdf_view and if the checkbox is checked returns its id to a hidden input #multi_client_id

The second is a select all checkbox. Which when checked selects all the checkboxes in with the same name. The select all checkbox is outside the #table_pdf_view.

The problem is when I use the select all checkbox the value returned to the hidden input is not correct. It returns the id of the select all check box only and not the ids of the other checkboxes and I do not know why.

  • 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-06T23:25:46+00:00Added an answer on June 6, 2026 at 11:25 pm

    The reason thats happening is because the Select All checkbox is also a checkbox within the div that you are using this selector on:

      var $checkboxes = $("#table_pdf_view input[type=checkbox]");
    

    You need to move it out of that div, or change the way you are getting all of the checkboxes.

    For example if you look at the following page, it tells you how to ignore a certain checkbox:

    jQuery – How to select all checkboxes EXCEPT a specific one?

    Hope this helps.

    UPDATE

    Here is the working version:

      //Handle Multi Download
      $(document).ready(function() {
      var $checkboxes = $('#table_pdf_view input:checkbox:not("#sa_download")');
      $checkboxes.on('change', function() {
            var ids = $checkboxes.filter(':checked').map(function() {
            return this.id;
        }).get().join(',');
        $('#multi_client_id').val(ids);
      });
      });
    
    
      $(document).ready(function(){ // 1
       // 2
           $(':checkbox.selectall').on('click', function(){
           // 3
               $(':checkbox[name=' + $(this).data('checkbox-name') + ']').prop("checked", $(this).prop("checked"));
               $(':checkbox[name=' + $(this).data('checkbox-name') + ']').trigger("change");
           });
    
       });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having trouble with the following scenario: 2 Edit's Type something in Edit1 and
I am having trouble implementing the following behaviour in a dropdown menu with jQuery.
I'm having trouble removing the first two characters from my char array. input[MAXSIZE] =
I'm having trouble mapping the following in NHibernate: I have two tables (these are
I'm having trouble merging two PDF files with pyPdf. When I run the following
I'm having trouble inserting a buffer in Emacs. Say I have the following two
im having some trouble with the following code: Ext.define('...controller...', { extend: 'Ext.app.Controller', init: function()
I'm having trouble figuring this out. I have two checkboxes (in the future will
I'm having trouble following this guide to extract my interfaces and entities from my
I am having trouble following the AngelScript manual on the proper way to register

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.