checkboxes group select all

How to implement a select all function for checkboxes in ChronoForms.

Overview

The issue arises from using outdated JavaScript methods that are incompatible with newer CF versions.
Use the Table view's built-in Selector behavior to automatically add a select all checkbox, or update custom JavaScript to work with the latest CF framework.

Answered
ChronoForms v8
Pk Pkoll 10 Dec, 2024

Hi Max,

I have a Ckeckbox group and I want to have the possibility to "select all". How can I do that?

Can you help me?

Greetings

Paul

Max_admin Max_admin 10 Dec, 2024

You need to use some javascript code in a JavaScript view:

document.querySelector("input[name='checkoboxes-name']").forEach(check => {
check.checked = true
})

this code should run when your select all checkbox or button is clicked

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Pk Pkoll 11 Dec, 2024

Hi Max,

I have this simple form with your javascript, but nothing changed. What is the problem and what do I wrong?

checkboxes group select all image 1

Paul

Max_admin Max_admin 11 Dec, 2024

the code should be inside an event listener:

document.querySelector("#id").addEventListener("click", e => {
    document.querySelector("input[name='checkoboxes-name']").forEach(check => {
        check.checked = true
    })
})

where #id is the id of the field to be clicked, you need to change this based on your requirements

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Pk Pkoll 12 Dec, 2024

Hi max,

I have tried all kind of triggers etc..

Can you please send me a working example how to use javascript te change the checkboxes.

Paul

Max_admin Max_admin 13 Dec, 2024

I tested the following code and is working:

document.addEventListener("DOMContentLoaded", function (event) {
    document.querySelector("[name='checkbox_2']").addEventListener("change", e => { // checkbox_2 is the name of the master checkbox
        document.querySelectorAll("input[name='checkboxes_3[]']").forEach(check => { // checkboxes_3[] is the name of the other checkboxes
            Nui.Checkbox.getInstance(check.closest(".nui.checkbox")).toggle()
        })
    })
})

I have also added "Select All" to the list of Listener actions which can be fired on triggers

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Pk Pkoll 13 Dec, 2024

Thanks Max

it works

Paul

Pk Pkoll 19 Dec, 2025

Hi Max,

last year you gave me this solution for a Select all problem. But after installing version V8.0.49 it doesn't work anymore. 

I work with the latest version and there is a listener action but I doen't know how to trigger this one and there isn't a solution for de-select.

In version  49 it stil works with the Javascript you gave me.

So is there a solution for this?

Greetings,

Paul

Max_admin Max_admin 19 Dec, 2025
Answer

Hi Paul

In the latest update there Table view has a Selector behavior where you can set the column name to have a selector checkbox, that will add a Select All checkbox automatically to the header

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Pk Pkoll 20 Dec, 2025

Hello Max,

I'll use the table view, but why doesn't the previous solution work anymore? In version 8.0.49, this wasn't a problem, and the JavaScript solution worked without issue.

Greetings,

Paul

Max_admin Max_admin 20 Dec, 2025

Hi Paul

I'm not sure, please open your browser console, do you have any errors before or after clicking the checkbox ?

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Pk Pkoll 20 Dec, 2025

Hi Max,

This is the output in console:

  }</style><script type="text/javascript">document.addEventListener("DOMContentLoaded", function (event) {    document.querySelector("[name='selecteer_alle_leden']").addEventListener("change", e => { // checkbox_2 is the name of the master checkbox        document.querySelectorAll("input[name='leden[]']").forEach(check => { // checkboxes_3[] is the name of the other checkboxes            Nui.Checkbox.getInstance(check.closest(".nui.checkbox")).toggle()        })    })})</script>

Paul

Max_admin Max_admin 20 Dec, 2025

Could you please post a screenshot ?

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Pk Pkoll 21 Dec, 2025

Hi Max,

Is this where looking for?

checkboxes group select all image 2

greetings 

Paul

Pk Pkoll 28 Dec, 2025

Hi Max,

Do you know what the problem is?

Happy New Year.

Paul

Max_admin Max_admin 16 Jan, 2026

Hi Paul

The error will be under the Console tab in your last image, apologies for the late reply

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Post a Reply