HTML The Definitive Guide (103 page)

Read HTML The Definitive Guide Online

Authors: Chuck Musciano Bill Kennedy

BOOK: HTML The Definitive Guide
13.25Mb size Format: txt, pdf, ePub

Chapter 10

Forms

 

10.5 The Tag

Use the tag to define any one of a number of common form "controls," as they are called in the HTML 4.0 standard, including text fields, multiple-choice lists, clickable images, and submission buttons. Although there are many attributes for the tag, only the type and name attributes are required for each element (only type for a submission or reset button; see following explanation). And as we describe in detail later, each type of input control uses only a subset of the allowed attributes. Additional attributes may be required based upon which type of form element you specify.

Table 10.1
summarizes the various form types and attributes, required and optional.

Table 10.1: Required and Optional Form Element Attributes
Form Tag or

Attributes

Type (× =

required;

^
=

optional;

blank
= not

supported)

accept

accesskey align alt border cols checked disabled maxlength multiple name notab onBlur onChange onClick onFocus onSelect readonly rows size src tabindex taborder usemap value wrap
button
^

^

×

^

^

^

^

^

^

×

checkbox

^

^

^

×

^

^

^

^

^

×

file

^

^

^

^

×

^

^

^

^

^

^

^

^

^

^

hidden

×

×

image

^

^

^

^

^

^

^

^

×

^

^

^

password

^

^

^

×

^

^

^

^

^

^

^

^

^

^

×

radio

^

^

^

×

^

^

^

^

^

×

reset

^

^

^

^

^

^

^

submit

^

^

^

^

^

^

^

^

text

^

^

^

×

^

^

^

^

^

^

^

^

^

^

^