I am able to select all of the items in a checkbox group with SSJS by simply setting the component's value.
But how would I do this in CSJS?
I am able to select all of the items in a checkbox group with SSJS by simply setting the component's value.
But how would I do this in CSJS?
You select them with
dojo.query
and set the selected property to true. You need to check: every box will have its own ID, but the beginning of it is the same -or- you use a class. Or you look for the first and then select all siblings.The strategy depends on your application's needs.
Check the dojo.query documentation for your options.
this is how you do it in jquery
Simplifying Naveen's answer, this worked great for me:
Assuming that the name of your check box group is
checkBoxGroup
this code snippet of check all checkbox should do the trick for you.