Easy Tutorial
❮ Prop Style Wordwrap Prop Style Borderimagerepeat ❯

Form enctype Attribute


Definition and Usage

The enctype attribute sets or returns the MIME type for encoding the form content.

If the form does not have an enctype attribute, the default value when submitting text is "application/x-www-form-urlencoded".

When the input type is "file", the value is "multipart/form-data".

Syntax

The enctype attribute can have the following values:

Value Description
application/x-www-form-urlencoded All characters are encoded before sending (default)
multipart/form-data No characters are encoded. This value is used for controlling form file uploads
text/plain Spaces are converted to "+" symbols, but no special character encoding

Browser Support

All major browsers support the enctype attribute.

Note: Internet Explorer and Safari browsers return "application/x-www-form-urlencoded" if no enctype attribute is defined (default value), while other browsers do not return a value.


Example

Return the encoding type of the form data sent to the server:

The output of the above example:

❮ Prop Style Wordwrap Prop Style Borderimagerepeat ❯