Have you ever completed an online
form—perhaps a survey of some
sort—that included check box after
check box after check box? If so, you
may have wished for a way to select all
of those check boxes with a single click.
(Or you may have moved on without
giving accurate information simply
because you didn’t want to take the
time to select all those little boxes.)
There’s nothing you can do about
this situation on other people’s sites,
but with a little JavaScript wizardry, you
can make the forms on your own sites
much easier to use. In this article, we’ll
show you how to create a form button
to select—or deselect—all the check
boxes in a group with a single click.
Make a list and check it once
We’ll begin this article by creating a
test form with a group of check boxes
that site visitors can use to sign up for
various email newsletters, as shown in
Figure A. We’ll also add a button to this
f...
