• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 68. Working with Form Widgets > Working with Checkboxes

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">
        Entertainment</td>
    </tr>
    <tr>
      <td><input type="checkbox" name="humorCheck" value="yes">
        Humor</td>
    </tr>
  </table>
</form>


					  


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint