CheckBox Test

Check boxes are stand-alone elements; that is, they don't interact with neighboring elements like radio buttons do. Therefore they are a bit easier to use. Using JavaScript you can test if a check box is checked or not using the checked property. Likewise, you can set the checked property to add or remove the checkmark from a check box.
CheckBox 1
CheckBox 2
CheckBox 3

<SCRIPT>

function testButton(form) {
     var alertStr = "";

     for (Count = 0; Count < 3; Count++) {
          if (form[Count].checked) alertStr += "CheckBox " + (Count + 1) + " is checked\n";
     }

     // if (alertStr == "") alertStr = "No CheckBox was selected";
     if (!alertStr) alertStr = "No CheckBox was selected";

     alert(alertStr);
}

</SCRIPT>

<FORM NAME="testform">
     <INPUT TYPE="checkbox" NAME="check1" VALUE="Check1">Checkbox 1
     <INPUT TYPE="checkbox" NAME="check2" VALUE="Check2">Checkbox 2
     <INPUT TYPE="checkbox" NAME="check3" VALUE="Check3">Checkbox 3
     <INPUT TYPE="button" VALUE="Click" onClick="testButton(this.form)">
</FORM>

As with the radio button object, add a CHECKED attribute to the HTML for that check box you wish to be initially check when the form is first loaded.

<INPUT TYPE="checkbox" NAME="check1" VALUE="Check1" CHECKED>Checkbox 1

You can also set the button selection programmatically with JavaScript, using the CHECKED Property. Specify the name of the checkbox you want to check, as in

form.check1.checked = true;