enctype(HTML attribute)

Syntax

Description

The
enctype attribute’s purpose is to indicate how
form data should be encoded prior to it being sent to
the location defined in the action attribute. By
default, form data is encoded so that spaces are converted to
"+" symbols, and special characters—for example,
apostrophes, percentage and other symbols, and so on—are converted to
their ASCII HEX equivalents.

Example

In this example, the
enctype attribute tells the browser to send form
data unencoded:

Value

The default value (which is assumed,
and doesn’t need to be set explicitly) is
"application/x-www-form-urlencoded". It ensures that
all characters are encoded before they’re sent to the server. The other
possible values are "multipart/form-data", which is
required when you’re using forms that have a file upload control (it
ensures that no character conversion takes place, and transfers
form data as a compound MIME document), and
"text/plain", which converts spaces to
"+" symbols, but doesn’t HEX-encode special characters
such as apostrophes.

Compatibility

Internet Explorer

Firefox

Safari

Opera

Chrome

5.5

6.0

7.0

8.0

1.0

1.5

2.0

3.0

3.5

1.3

2.0

3.1

4.0

9.2

9.5

10.0

2.0

Full

Full

Full

Full

Full

Full

Full

Full

Full

Full

Full

Full

Full

Full

Full

Full

Full

It causes no
compatibility issues, and has excellent support across all tested
browsers.