Checkboxes - Select All

  • 24 February 2017
  • 3 replies
  • 23 views

Badge +2

I have a list lookup which displays the multiple values retrieved as a checkbox list.

I also have a yes/no box above called SelectAll.

199877_pastedImage_1.png

Is there any way to set it so that when SelectAll is ticked, all the values in the checkbox list are ticked?

Any help would be appreciated. Thanks.


3 replies

Userlevel 4
Badge +12

Only with JavaScript. You would need to build something like this into your form:

$("#checkAll").click(function(){    
$
('input:checkbox').not(this).prop('checked', this.checked);
});
Badge +2

I'm not very experienced with javascript or using it in Nintex Forms.

Could you please explain how to set this up?

I've put the javascript you posted into the custom javascript section of the settings, but I'm not too sure where to go from there.

I've replaced the checkAll ID and "input:checkbox" with the ClientID javascript variable name for each control.

NWF$(selectallCID).click(function(){    
NWF$(countriesCID).not(this).prop('checked', this.checked);
});

Am I doing this right?

Userlevel 7
Badge +17

The second selector of "input:checkbox" is needed so it finds all the available check boxes and then checks them. If you add one control, then it may not select them all

Reply