Skip to main content
Nintex Community Menu Bar

Auto-check ALL list lookup options

  • July 10, 2019
  • 3 replies
  • 15 views

Forum|alt.badge.img+2

I have a List Lookup that is filtered by several cascading drop-downs.

How do I default to having all the options returned checked? I have searched the previous solutions but can't quite get them to work. I have tried giving the list lookup a CSS name and a Javascript client ID. In this case it's "TaskList". 3111iBBD4B86A156149B8.png

This works when giving the user an option button to Select All.

NWF$('#'+TaskList).click(function(){
NWF$('input:checkbox').not(this).prop('checked', this.checked);
});

However, this info lives in a repeater row. Adding another repeater row breaks the Select All for that subsequent row.

 

I would like everything to just be auto-selected on load.

3 replies

Forum|alt.badge.img+2

This ALMOST works. It does check the boxes, but the form doesn't save the results or values of the checked boxes.

 

NWF.FormFiller.Events.RegisterAfterReady(function(){ 

var myElement = document.querySelectorAll('input[type=checkbox]')[0];

var observer = new MutationObserver(function(mutations) {
   if (document.contains(myElement)) {
        console.log("Checkbox Added");         

        NWF$('input:checkbox').prop('checked', true);
    }
});

observer.observe(document, {attributes: false, childList: true, characterData: false, subtree:true});
});


Forum|alt.badge.img+2

Should also note that this only works in Microsoft Edge and Chrome.


Forum|alt.badge.img+2

This script works. The key is to trigger('click') on the selected option.

 

NWF.FormFiller.Events.RegisterAfterReady(function(){
var myElement = document.querySelectorAll('input[type=checkbox]')[0];
var count = 0
var observer = new MutationObserver(function(mutations) {
if (document.contains(myElement) && NWF$('input:checkbox').prop('checked', false)) {
// console.log("Checkbox Added");
NWF$('input[type=checkbox]').trigger('click');
//count++
//console.log(count);
}
});
observer.observe(document, {attributes: false, childList: true, characterData: true, subtree:true});
});