top of page
Important forum update
This forum is migrating to one unified Wix community forum starting July 26th, and will be read-only during the process.
![feature fixed.png](https://static.wixstatic.com/media/3bfa8a_f845e1016b8a49758acdd6edd6610c3b~mv2.png/v1/crop/x_0,y_2,w_852,h_508/fill/w_104,h_62,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/feature%20fixed.png)
Wishlist Page is the official platform for requesting new features. You can vote, comment, and track the status of the requested features.
bottom of page
@funcubed4me You will need to adjust this code to account for your various checkbox names that you have and the maximum that you want to allow. Each checkbox will need to have an onChange event within the onReady of the page
$w.onReady(function () { $w("#checkbox1").onChange((event) => { CheckMaximum("#" + event.target.id) }) $w("#checkbox2").onChange((event) => { CheckMaximum("#" + event.target.id) }) $w("#checkbox3").onChange((event) => { CheckMaximum("#" + event.target.id) }) $w("#checkbox4").onChange((event) => { CheckMaximum("#" + event.target.id) }) $w("#checkbox5").onChange((event) => { CheckMaximum("#" + event.target.id) }) $w("#checkbox6").onChange((event) => { CheckMaximum("#" + event.target.id) }) $w("#checkbox7").onChange((event) => { CheckMaximum("#" + event.target.id) }) $w("#checkbox8").onChange((event) => { CheckMaximum("#" + event.target.id) }) $w("#checkbox9").onChange((event) => { CheckMaximum("#" + event.target.id) }) $w("#checkbox10").onChange((event) => { CheckMaximum("#" + event.target.id) }) }); export function CheckMaximum(CalledFrom){ let checked = 0; let pageElements = $w("#page1").children; // loop through all of the elements on the page pageElements.forEach((Element) => { // dealing with only checkboxes if (Element.type === "$w.Checkbox"){ // increment if checked checked = (Element.checked)? checked + 1:checked; // using 5 for maximum check; adjust as needed. if (checked > 5){ // exceeded max, uncheck checkbox that was just checked $w(CalledFrom).checked = false; } } }) }