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

The Archive Base Latest Questions

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

We are calling a jQuery function using onclick on a checkbox. We want that

  • 0

We are calling a jQuery function using onclick on a checkbox. We want that checkbox to toggle all checkboxes below it. Here is the HTML for the toggle checkbox:

    <input type="checkbox" id="toggle" name="toggle" class="daxle_cb" value="" onclick="daxleToggleCB('adminForm');" />

And here is the function:

    function daxleToggleCB( formName )
    {
        jQuery('#' + formName).find('input[type=checkbox]').prop('checked', this.checked);
    };

However, this is not working. What does work is this:

    function daxleToggleCB( formName) {
        jQuery( ':checkbox[name=toggle]' ).click
        (
            function ()
            {
                jQuery( '#'+formName ).find( 'input[type=checkbox]' ).prop( 'checked', this.checked );
            }
        ); 
    };     

Although, this function only works on the third click of the checkbox. So the problem is getting the checkboxes to toggle on the first click.

  • 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:46:54+00:00Added an answer on June 18, 2026 at 7:46 am

    first, your not binding your jQuery.click() event until it’s been clicked once at least.

    then it looks like you have two events firing.

    you have the inline onclick event, as well as the jQuery.click event.

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

Sidebar

Related Questions

I'm calling a page method using a jquery function that's somewhat like this: function
I can set the onclick handler using jQuery by calling $('#id').click(function(){ console.log('click!'); }); Also
Using the following JQuery/AJAX function I'm calling a partial view when an option is
i'm trying to submit my Ajax form using jQuery. However calling the submit() function
I have a PHP script that I'm calling with the .post() function in jQuery.
Here's a dead-simple webpage that leaks memory in IE8 using jQuery (I detect memory
I'm having problems calling jQuery functions after replacing a div's content by using .html()
I'm using jQuery autocomplete plugin from jQuery website calling the controller url which return
I have a plugin for uploading files using jquery uploadify. After calling a method
I have the following javascript using jquery code: function MakeAnimation(anim_times) { for (k=1; k<=anim_times;

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.