HTML - статьи

FORM


Description

The FORM element creates a fill-out form.

The browser permits the user to enter information in the fields of

the form and sends this information to a cgi-bin script on a server

identified as a by the ACTION attribute.

METHOD=GET (the default) appends the input information to the

ACTION URL which on most receiving systems becomes

the value of the environment variable QUERY_STRING.

METHOD=POST (the preferred) sends the input information in a data body

which is available on stdin with the data length set

in the environment variable CONTENT_LENGTH.

Form data is a stream of name=value pairs

separated by the & character.



Each name=value pair is URL encoded,

i.e. spaces are changed into the plus character and some characters

are encoded into hexadecimal.

At least one of the following is expected inside the FORM

contents: INPUT, SELECT, TEXTAREA.

Minimum Attributes

<FORM></FORM>

All Possible Attributes

<FORM ACTION="..."

METHOD=GET|POST

ENCTYPE="..."

LANG="..."

DIR=ltr|rtl

ACCEPT-CHARSET="..."

SCRIPT="...">

</FORM>

Elements Allowed Within...

members of group

and elements

but not element

Allowed In Content Of...

Any element that permits members of group

Variations

The original definition of FORM only defined the default value of

application/x-www-form-urlencoded

for the ENCTYPE attribute.

RFC 1867 adds the value of multipart/form-data

for this attribute to permit a FORM to upload one or more files

in addition to the FORM data. METHOD=POST is required with

this value of ENCTYPE.

This file upload extension is implemented in Netscape 2.0.

Most current browsers only handle ACTION for the

http: access type, but proposals for handling the

mailto: access type are being discussed.

The LANG, DIR, and ACCEPT-CHARSET attributes are introduced with the

internationalization proposal.

The ACCEPT-CHARSET attribute is to provide a hint as to the

character set or sets that the receiving URL is prepared to handle.

Version 3 proposes the SCRIPT attribute to specify a URL which

contains a limited syntax script to be downloaded to the browser

for execution to preprocess the FORM output before sending it

to the ACTION destination.

This SCRIPT proposal may change as part of the new proposals

concerning APPLET and EMBED.

All elements concerning FORM are Level 2.



Содержание раздела