Skip to main content
Nintex Community Menu Bar
Question

Help with jQuery for Select All checkbox


dperani
Forum|alt.badge.img+5

I have a form with 10 checkboxes that users would like a Select All checkbox added so they don’t have to check all ten manually:

I have tried adding jQuery to get it to work but nothing seems to work.  I have named (not control name but Javascript named) the Select All checkbox to chkSelectAll and all 10 of the other checkboxes are  chkDay.  Here is my Javascript:

 

NWF.FormFiller.Events.RegisterAfterReady(function () {
    //when Select All checkbox is changed 
    NWF$("#" + chkSelectAll).on("change", function(event){
        var isChecked = NWF$(event.target).prop("checked");
        // if Select All checkbox is checked
        if (isChecked) {
            // all Day checkboxes get checked 
                NWF$(':checkbox.chkDay').prop('checked', this.checked);
        }


        //uncheck Select All checkbox
        NWF$("#" + chkSelectAll).prop("checked", false);
    });
});

 

TIA,

Dawn

Translate

0 replies

Be the first to reply!

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings