About HTML Checkboxes
- The check box is a basic visual element, simply placing a small square box on the page. As there is no visual difference between the boxes, it is important to use the design of the page to show the reader what the box represents. For example, placing the boxes in a list, with text stating what the box stands for next to each individual box. The check box is an inline element, meaning it will be placed exactly where it is listed in the code, with no automatic line break, so it is common to precede a check box with text of what it stands for, and follow it with "<br /> to start a new line.
- The check box code is a style of self-contained tag known as an input tag. To create an input tag as a check box type the following:
<input type="checkbox" name="groupname" value="valuename" />
To customize the check box, change "groupname" to the identifier chosen for the grouping being created, such as "foods" if creating a list of potential foods the reader enjoys, and "valuename" to a unique identifier for the item, such as "oranges" for a check box ticked if the reader enjoys oranges. - When creating a page that is hosting multiple different sets of information it is important to use grouping to differentiate between the groups, so that the data for each does not become combined. To separate different groups on a page, use the "name=" command. If a site wants to find out drinks the reader likes, for example, we would add a set of checkboxes with a name of "drinks" in addition to the "foods" check boxes.
- The check box is a very useful tool, despite its simplicity, and is commonly used on user feedback pages. The most common uses for a check box are in surveys and in user customization. For a survey, the results of multiple users on a website are tabulated, and the results of the check boxes are tallied. For user customization a user is able to make choices about how the website being used appears to them in order to best match the needs of each registered user.
Visual Display
Coding
Grouping
Practical Uses
Source...