O'Reilly logo

Dynamic HTML: The Definitive Reference by Danny Goodman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

<INPUT> — NN all IE all HTML all

Synopsis

<INPUT>

End Tag: Forbidden

An INPUT element is sometimes known as a form control, although not all INPUT elements are visible on the page. For the most part, an INPUT element provides a place for users to enter text, click buttons, and make selections from lists. The data gathered from this interaction can be submitted to a server-side program (when the surrounding FORM element is submitted), or it may be used strictly on the client as a way for users to interact with client-side scripts.

Prior to HTML 4.0, INPUT elements were supposed to be wrapped by a FORM element in all instances. This restriction is loosening up, but Navigator 4 still requires the FORM wrapper in order to render INPUT elements.

The primary attribute that determines the kind of control that is displayed on the page is the TYPE attribute. This attribute can have one of the following values: button, checkbox, file, hidden, image, password, radio, reset, submit, or text. Not all INPUT element types utilize the full range of other attributes; sometimes a single attribute has different powers with different element types. For each attribute of the INPUT element, the listing specifies the types to which it applies. Although the TEXTAREA element has its own tag, it is often treated like another form control.

Example

<FORM METHOD=post ACTION="http://www.giantco.com/cgi-bin/query"> First Name: <INPUT TYPE="text" NAME="first" MAXLENGTH=15><BR> Last Name: <INPUT TYPE="text" NAME="last" ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required