Skip to main content
Nintex Community Menu Bar
Solved

Check All Check Boxes

  • July 27, 2022
  • 4 replies
  • 193 views
  • Translate

kgiles
Forum|alt.badge.img+4

I have a Classic 2013 form with a cascading checkbox. 

I need to be able to Select All check box results. 

I've asked this question before but have yet to find an answer. Please help!
 

Describer:
1. Select Specialty. This control is a Choice Field with drop down selected. Java name "Specialty"

24748iB4628FA4A3B527CB.png

2. A list of emails pops up. This control is a SharePoint List Lookup with check box (Multiple-Selection) selected. Java name "emailID"

24749iE3FADD3A7BC33230.png

3. I have a checkbox on my form. Java name "SelectAll"

4. I would like to be able to check "SelectAll" and have all the email check boxes (emailID) checked. 

 

Please and thank you

Best answer by MegaJerk

No need to do anything to that control, I just modified the code I gave you above to the following:

NWF.FormFiller.Events.RegisterAfterReady(function () { NWF$("#" + Specialty).on("change", function(event){ NWF$("#" + SelectAll).prop("checked", false); }); NWF$("#" + SelectAll).on("change", function(event){ var isChecked = NWF$(event.target).prop("checked"); if (isChecked) { NWF$("#" + emailID).siblings("table").find("input:checkbox").each(function(index, checkbox){ NWF$(checkbox).prop("checked", true).trigger("change"); }); } }); });

 

It now has a trigger which indicates to the form that the control should update any dependencies, and should make your Calculated Control update correctly. 

 

Please mark this thread as solved if this concludes the answers to this problem.  

View original
Did this topic help you find an answer to your question?

4 replies

MegaJerk
Forum|alt.badge.img+14
  • Scholar
  • 834 replies
  • July 28, 2022

This is pretty simple but includes some custom code so I will try to make it as simple as I can. 

 

I didn't want to try to recreate your lists for lookup exactly, and already had a list I use for dummy lookups called Fruits List, so I have created another list of Fruit Experts who all have some amount of Fruits associated to them via a Lookup:

 

 

The Fruit Experts List Titles will stand in for the "EmailID" emails on your form

 

Speaking of forms, I have made a dummy form close to what I've seen of yours:

 

I've also configured the Controls to have the same JavaScript ID names as what you've given to your controls:

 

Email IDs

 

Select All checkbox

 

The rest is pretty straight forward. Open up the Settings of your form using the Settings button in the Ribbon:

 

Then expand the "Custom JavaScript" section, paste in the following code, and save:

 

NWF.FormFiller.Events.RegisterAfterReady(function () { NWF$("#" + Specialty).on("change", function(event){ NWF$("#" + SelectAll).prop("checked", false); }); NWF$("#" + SelectAll).on("change", function(event){ var isChecked = NWF$(event.target).prop("checked"); if (isChecked) { NWF$("#" + emailID).siblings("table").find("input:checkbox").each(function(index, checkbox){ NWF$(checkbox).prop("checked", true); }); } }); });

 

 

As Shown:

 

The Results will be that now when your form is loaded, the Select All button should check all of the checkboxes in the emailID Control, and if you make a change to the Specialty (or in my case, fruit), it will uncheck the "Select All" checkbox:

 

 

 

Let me know if you need further assistance. 

 

 

 

 

Translate

kgiles
Forum|alt.badge.img+4
  • Author
  • Rookie
  • 27 replies
  • July 28, 2022

That worked perfect! Thank you so much! I'm having one more tiny issue...

I have a Calculated Value Field, Java Name "EmalCalc" . 

It used to pull in the values when the check boxes were checked.  
Now that the Select All feature has been added, this isn't happening. I can still get it to work if I manually click on the check boxes. 
Here is the formula I am using. I need this to populate with all the emails when Select All is clicked. 

Please and thank you! 

 

 

Translate

MegaJerk
Forum|alt.badge.img+14
  • Scholar
  • 834 replies
  • Answer
  • July 28, 2022

No need to do anything to that control, I just modified the code I gave you above to the following:

NWF.FormFiller.Events.RegisterAfterReady(function () { NWF$("#" + Specialty).on("change", function(event){ NWF$("#" + SelectAll).prop("checked", false); }); NWF$("#" + SelectAll).on("change", function(event){ var isChecked = NWF$(event.target).prop("checked"); if (isChecked) { NWF$("#" + emailID).siblings("table").find("input:checkbox").each(function(index, checkbox){ NWF$(checkbox).prop("checked", true).trigger("change"); }); } }); });

 

It now has a trigger which indicates to the form that the control should update any dependencies, and should make your Calculated Control update correctly. 

 

Please mark this thread as solved if this concludes the answers to this problem.  

Translate

kgiles
Forum|alt.badge.img+4
  • Author
  • Rookie
  • 27 replies
  • July 28, 2022

Woooohooo! That did it! Thank you so much!

Translate

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