Friday, June 20, 2025
HomejQuerySynchronize Associated Checkboxes with Checkboxes.js jQuery Plugin

Synchronize Associated Checkboxes with Checkboxes.js jQuery Plugin


A light-weight test all jQuery plugin created to synchronize associated checkboxes which have a guardian/baby relationship.

When the guardian checkbox is clicked, the plugin will then routinely test or uncheck all baby checkboxes primarily based on the guardian’s state. Equally, when a toddler checkbox is clicked, it is going to test the guardian checkbox if all baby checkboxes are checked.

It may be helpful in internet varieties the place customers would possibly have to carry out actions on a number of gadgets concurrently – akin to deleting a number of emails, choosing a number of merchandise, or making use of an motion to a number of admin information.

Tips on how to use it:

1. Add the minified model of the Checkboxes.js plugin after jQuery library.

<script src="/path/to/cdn/jquery.slim.min.js"></script>
<script src="/path/to/jquery.checkboxes.min.js"></script>

2. Name the perform checkboxes() on the guardian checkbox and passing within the selector for its baby checkboxes.

<!-- Test All -->
<enter kind="checkbox" id="chkAll" />

<!-- Youngster Checkboxes -->
<enter kind="checkbox" id="chk01" identify="chk01" />
<enter kind="checkbox" id="chk02" identify="chk02" />
<enter kind="checkbox" id="chk03" identify="chk03" />
...
$(perform () {
  $("#chkAll").checkboxes({
    itemChild: "chk",
  });
});

This superior jQuery plugin is developed by dangvanthanh. For extra Superior Usages, please test the demo web page or go to the official web site.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments