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

The Archive Base Latest Questions

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

I have several collapsible check-boxes, and am trying to check/uncheck all the boxes within

  • 0

I have several collapsible check-boxes, and am trying to check/uncheck all the boxes within that section.

HTML

Currently when I click on the main checkbox, it simply opens and closes the collapsible dialog.

<li data-role="collapsible" id="educationlayers">
            <h3>
                <input type="checkbox" name="education" id="education" class="layers"/>
                <label for="education">Education</label>
            </h3>
            <fieldset data-role="controlgroup">
                <input type="checkbox" data-mini="true" name="education" id="daycare" class="layers"/>
                <label for="daycare">Day Care</label>
                <input type="checkbox" data-mini="true" name="education" id="elementary" class="layers"/>
                <label for="elementary">Elementary</label>
                <input type="checkbox" data-mini="true" name="education" id="intermediate" class="layers"/>
                <label for="highschool">High School</label>
                <input type="checkbox" data-mini="true" name="education" id="postsecondary" class="layers"/>
                <label for="postsecondary">Post Secondary School</label>
            </fieldset>
         </li> 
         <li data-role="collapsible" id="emergencylayers">
               <h3>
                    <input type="checkbox" name="emergency" id="emergency" class="layers"/>
                    <label for="emergency">Emergency</label>
                </h3>
                <fieldset data-role="controlgroup">
                    <input type="checkbox" data-mini="true" name="emergency" id="ambulance" class="layers"/>
                    <label for="ambulance">Ambulance Station</label>
                    <input type="checkbox" data-mini="true" name="emergency" id="fire" class="layers"/>
                    <label for="fire">Fire Station</label>
                    <input type="checkbox" data-mini="true" name="emergency" id="hospital" class="layers"/>
                    <label for="hospital">Hospital</label>
                    <input type="checkbox" data-mini="true" name="emergency" id="police" class="layers"/>
                    <label for="police">Police</label>
                </fieldset>
          </li>
          <li data-role="collapsible" id="facilitieslayers">
                 <h3>
                    <input type="checkbox" name="facilities" id="facilities" class="layers"/>
                    <label for="facilities">Facilities</label>
                </h3>
                <fieldset data-role="controlgroup">
                    <input type="checkbox" data-mini="true" name="facilities" id="commerce" class="layers"/>
                    <label for="commerce">Chamber of Commerce</label>
                    <input type="checkbox" data-mini="true" name="facilities" id="cityfacility" class="layers"/>
                    <label for="cityfacility">City Facility</label>
                    <input type="checkbox" data-mini="true" name="facilities" id="cityhall" class="layers"/>
                    <label for="cityhall">City Hall</label>
                    <input type="checkbox" data-mini="true" name="facilities" id="govfacility" class="layers"/>
                    <label for="govfacility">Government Facility</label>
                </fieldset>
          </li>

JQuery

JQuery code that doesn’t seem to work.

$(document).ready(function() {
    fixContentHeight();
    $('#education').click(function() {
        $("INPUT[name='education']").attr('checked', $('#education').is(':checked'));
    });
});

Any tips would be helpful!

  • 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:43:22+00:00Added an answer on June 6, 2026 at 11:43 pm

    I don’t about what this function (fixContentHeight();) is doing.

    Do this way, it works as expected.

    //fixContentHeight();
    $('#education').click(function() {
        $("INPUT[name='education']")
            .attr({
                checked: $('#education').is(':checked')
            });
    });​
    

    Follow the same fashion for other checkbox sections.

    Refer LIVE DEMO

    UPDATED:

    Refer this same piece of code which I have done some modifications to works for all checkbox sections,

    //fixContentHeight();
    $('h3 input[type=checkbox]').click(function() {
        $("INPUT[name='"+this.name+"']")
            .attr({
                checked: $(this).is(':checked')
            });
    });​
    

    HTML:

    Actually on your HTML <UL> tag is missing.

    <ul>
        <li data-role="collapsible" id="educationlayers">
            <h3>
                <input type="checkbox" name="education" id="education" class="layers"/>
                <label for="education">Education</label>
            </h3>
            <fieldset data-role="controlgroup">
                <input type="checkbox" data-mini="true" name="education" id="daycare" class="layers"/>
                <label for="daycare">Day Care</label>
                <input type="checkbox" data-mini="true" name="education" id="elementary" class="layers"/>
                <label for="elementary">Elementary</label>
                <input type="checkbox" data-mini="true" name="education" id="intermediate" class="layers"/>
                <label for="highschool">High School</label>
                <input type="checkbox" data-mini="true" name="education" id="postsecondary" class="layers"/>
                <label for="postsecondary">Post Secondary School</label>
            </fieldset>
        </li>
        <li data-role="collapsible" id="emergencylayers">
            <h3>
                <input type="checkbox" name="emergency" id="emergency" class="layers"/>
                <label for="emergency">Emergency</label>
            </h3>
            <fieldset data-role="controlgroup">
                <input type="checkbox" data-mini="true" name="emergency" id="ambulance" class="layers"/>
                <label for="ambulance">Ambulance Station</label>
                <input type="checkbox" data-mini="true" name="emergency" id="fire" class="layers"/>
                <label for="fire">Fire Station</label>
                <input type="checkbox" data-mini="true" name="emergency" id="hospital" class="layers"/>
                <label for="hospital">Hospital</label>
                <input type="checkbox" data-mini="true" name="emergency" id="police" class="layers"/>
                <label for="police">Police</label>
            </fieldset>
        </li>
        <li data-role="collapsible" id="facilitieslayers">
            <h3>
                <input type="checkbox" name="facilities" id="facilities" class="layers"/>
                <label for="facilities">Facilities</label>
            </h3>
            <fieldset data-role="controlgroup">
                <input type="checkbox" data-mini="true" name="facilities" id="commerce" class="layers"/>
                <label for="commerce">Chamber of Commerce</label>
                <input type="checkbox" data-mini="true" name="facilities" id="cityfacility" class="layers"/>
                <label for="cityfacility">City Facility</label>
                <input type="checkbox" data-mini="true" name="facilities" id="cityhall" class="layers"/>
                <label for="cityhall">City Hall</label>
                <input type="checkbox" data-mini="true" name="facilities" id="govfacility" class="layers"/>
                <label for="govfacility">Government Facility</label>
            </fieldset>
        </li>
    </ul>
    

    Refer LIVE DEMO 2

    UPDATED 2:

    I have gone through your code and modified it. Finally I got your issue with the checkboxes.

    You need to refresh the checkboxradio, to get updated with checked value of all checkboxes.

    You need to use:-

    $("input[name='"+this.name+"']").checkboxradio("refresh");
    

    JS:

    $('h3 input[type=checkbox]').click(function() {
        $("input[name='"+this.name+"']")
            .attr({
                checked: $(this).is(':checked')
            });
        $("input[name='"+this.name+"']").checkboxradio("refresh");
    });
    

    Refer LIVE DEMO 3

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

Sidebar

Related Questions

I have several HTML elements (buttons) that fire the same JQuery AJAX request. When
I have several LESS files that are all imported into one master file (styles.less).
I have several classes (A, B, C, ...) that all use a List<AnotherClass> to
I have several actions that are protected by filters that check for logged_in? and
I have several boxes in html as <div class=parent> <div class=box></div> <div class=box></div> <div
I have several boxes (more than 100) that will be created dynamically in different
I have several Delphi programs that maintain connections to a database (some Oracle, some
I have several different numbers in a group that range in sizes and would
I have several xml files that are formated this way: <ROOT> <OBJECT> <identity> <id>123</id>
I have Several UIImageViews in a NSMutableArray. They are all in the superView. I

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.