Easiest way to create "Select All" Option with Checkboxes

Jan 23, 2013

Hi,

I was just wondering if anyone knows the best way to create a "Select All" checkbox that selects the following say 20 checkboxes automatically and then once you uncheck said checkbox, all of them will deselect as well?  Is there an easy way for this or do I just have to create triggers on every checkbox that leads back to the "Select All" checkbox or variable assigned to it?

Thanks for all your help!

Lauren

3 Replies
Christine Hendrickson

Hi Lauren,

I'm sure there's a more elegant way to do this, but I'm thinking that just creating the checkboxes and using triggers would do this just fine. You would simply need to copy and paste the trigger you use and assign it to the next checkbox. You could create a separate button to clear the selections and use the same method.

I know this isn't perfect and may not be exactly what you're looking for, but I created a quick example that you can see here. I also attached the file, if you want to take a look at the triggers I used.

Good luck with the project! Let us know how it goes

Rebecca Fleisch Cordeiro

Hi Christine and Lauren,

Christine, thanks for your response, which got me headed in the right direction. After reading what you said here, I created a story. And it works, as does the DeSelect All.

But then, I said, wait, what if Learners start the slide and

  • Click Select All and
  • then change their minds and click to deselect one of the choices. That means the Select All button should no longer be selected.

So, I added more triggers to accommodate that.

And that was OK, but then I said what if Learners start the slide and

  • Click to Select all
  • then click to deselect all
  • then change their minds and again select all. Deselect is still selected.

So I added a trigger to accommodate that.

Or, what if Learners started the slide and

  • Click to select all
  • then click to deselect all
  • then click one of the choices. Deselect all is still selected

So, I added trigger to accommodate that.

I think I have all permutations now, BUT I only have 3 choices here. This would be one heck of a LOT of trigger with 20 choices. So that gets back to your question, Lauren!! I'm wondering if variables would be a better solution here, but at the moment my brain is mush!

Uploading the story here in case y'all want to take a look.

Lauren Walter

Hi Rebecca!

What I did was I created two variables.  One trigger adds 1 to variable "SelectAll" whenever this checkbox is selected and then another trigger adds 1 to variable "UnselectAll" whenever the Select All checkbox is NOT selected.  Now, it doesn't matter the value of the variable as long as it changes and adding 1 will ensure that it will change everytime the Select All checkbox changes state.

Then, I added triggers for ALL of the checkboxes (1 through 20 except for obviously the Select All checkbox):

Action:  Change state of

Object:  Checkbox1

To state:  Selected

When:  Variable changes

Variable:  SelectAll

So, this will ensure that ALL of the boxes will SELECT when you click the Select All checkbox, so now the other set of triggers for the variable "UnselectAll" will enusre that all of them will UNSELECT:

Action:  Change state of

Object:  Checkbox1

To state:  Normal

When:  Variable changes

Variable:  UnselectAll

Let me know if you have any questions!

Thanks,

Lauren

This discussion is closed. You can start a new discussion or contact Articulate Support.