Check Boxes - The <input> Tag

Check boxes are most often used in cases of "check all that apply," or selecting multiple options. To create a check box, use the <input> tag and set the type attribute to 'checkbox'.

The main attribute of the checkbox is the name.

When a checkbox is checked, the value will be "ON". If two or more checkboxes have the same the name, then the server receives a list of the names that were checked.

Example:

<input type='checkbox' name='C1'>Swimming<br>
<input type='checkbox' name='C2'>Biking<br>
<input type='checkbox' name='C3'>Hiking<br>
<input type='checkbox' name='C4'>Running
Swimming
Biking
Hiking
Running