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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:10:11+00:00 2026-05-26T04:10:11+00:00

Im having trouble with a jquery function where i have 5 option boxes (which

  • 0

Im having trouble with a jquery function where i have 5 option boxes (which when clicked checks a checkbox) and a checkbox for “none of these”.

I am trying to create a function where you can select multiple options, and by checking the “none of these” checkbox, it resets them and, and vice versa where if you again select an option (or multiple), the “none of these” checkbox becomes unchecked.

Think of it as a market research question!

Copy of it below

http://jsfiddle.net/pGgkT/

Problem i am having is when i select, for example option 5,4,3 and then click “none of these”, then go bac to select 5,4,3, they take 2 clicks to select instead of just 1 which is only necessary for the others i didnt select originally (1,2).

  • 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-26T04:10:12+00:00Added an answer on May 26, 2026 at 4:10 am

    toggle internally adds a click handler to the div as per the documentation given here.
    To solve your issue you need to call a click on the checked divs when you click on none.

    I have made a simplified solution here

    You can solve this by changing the click handler for none option to :

    //Checkbox click - Remove selections 
    $("#none").click(function() {
        if ($("#none").attr("checked") == "checked") //IF "NONE OF THESE" IS CHECKED!
        {
            var parentsOfSelectedOptions = $( /*<<selector to get parent>>*/ );
            $(parentsOfSelectedOptions).each(function(item) {
                $(item).click();
            });
    
            //other actions
        }, function() {
            //other actions
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having trouble trying to accomplishing this.. Whatever option I select from a dropdown
I'm having some trouble writing a jQuery function and could use a little help.
Im having some trouble with jQuery's slideToggle function in IE8 for some reason the
I am having trouble checking checkboxes via JQuery - I have done this: if(element[1]==3)
I am having some trouble with jQuery. I want to have a dialog box
I'm having trouble with IE, jquery's slidedown() function and the cufon script. The website
I am having troubles with jQuery's load function and am hoping for some help.
I'm having trouble getting JQuery to load in IE7, works fine in all other
I'm having some trouble getting jQuery to play nice with DokuWiki - has anyone
I'm having trouble getting the jquery ui 1.8 dialog to center I've tried leaving

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.