Forms: HTML
Create Checkboxes

Create a Form Remember that you create a form field with the <FORM></FORM> tag pair.

Within the <FORM> tags will go the entire form, i.e. both the questions you ask and the form elements, i., e., the  box and button spaces where the user will supply responses

To create most form elements, use the following code:
<INPUT TYPE="[form]" NAME="[name]">
This tag does not require a closing tag
  • The TYPE attribute specifies the kind of form element (e.g., text box, button, etc.) you want to display.
  • The NAME attribute specifies the class of information being gathered by that particular form element.
  • When the information is processed by the server it will be identified by the term you assign to the NAME attribute.
The Check Box A check box is a form element similar to a radio button except that it allows users to make more than one choice in the offered list.

The checkbox tag requires a VALUE for each possible choice.

VALUE refers to the actual data being collected.

The VALUE attribute identifies the information gathered when a user specifies a particular choice from a list provided by you.

Example

Check all that apply: Full-time    Part Time  Day  Evening   Day and Evening

The HTML code used to create a checkbox is:

<INPUT TYPE="checkbox" VALUE="[value]">

[value] equals the name of each checkbox in the list.

Repeat the checkbox tag for each button in the list.

Change the VALUE attribute to reflect the content of the particular button.

The HTML code for the sample checkbox list  above is:

Check all that apply:

<INPUT TYPE="checkbox" VALUE="full">Full-time

<INPUT TYPE="checkbox" VALUE="part">Part-time

<INPUT TYPE="checkbox" VALUE="day">Day

<INPUT TYPE="checkbox" VALUE="eve"> Evening

<INPUT TYPE="checkbox" VALUE="dayeve">Day and Evening

Remember that this code goes within the <FORM></FORM> tag pair
Note  that I attached a value to each button that reflected the information it displays.

Forms: HTML
Overview
Create a Form
Create Text and Password Boxes
Create Radio Buttons
Create Checkboxes
Create Menu Boxes
Create Text Blocks
Create the Reset and Submit Buttons

Personal Home PageWeb Design CenterTutorial MenuTop of Page

Web Design Center
Last Revised: October 19, 2006
© Agatha Taormina