Working with Checkboxes

Checkboxes are ideal for relatively short sets of options where the visitor can select one, none, all, or as many as desired, as in Figure 68.2. Don't use checkboxes for either/or situations, where the visitor needs to choose one and only one option—radio buttons work better for those.

Listing 68.2. View Source for Figure 68.2.
 <form> <table> <tr> <td>Select the newsletters you would like to receive:</td> </tr> <tr> <td><input type="checkbox" name="newsCheck" value="yes"> News</td> </tr> <tr> <td><input type="checkbox" name="sportsCheck" value="yes"> Sports</td> </tr> <tr> <td><input type="checkbox" name="businessCheck" value="yes"> Business</td> </tr> <tr> <td><input type="checkbox" name="entertainmentCheck" value="yes"> ...

Get Web Design Garage now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.