Definition and Usage The enctype attribute specifies the character/MIME-type encoding of the form data being sent with the form applicatio...
Definition and Usage
The enctype attribute specifies the character/MIME-type encoding of the form data being sent with the form application.
By default form data is encoded like this:
- Spaces are converted to "+"
- Special characters are converted to ASCII HEX.
Syntax
<a enctype="encoding_type"> |
Syntax Example
Attribute Values
Value | Description |
encoding_type | Specifies the encoding used when sending form data.Possible values:
- application/x-www-form-urlencoded - Default. All characters are encoded before sent
- multipart/form-data - No characters are encoded. Form data is sent as a MIME document. This parameter is required when using file upload
- text/plain - Spaces are converted to "+", but no special character encoding
|
Browser Support
The attribute is supported in all major browsers.
Example
<form action="demo_form_accept.asp" enctype="text/plain">
First name:
<input type="text" name="FirstName" value="Harry" />
<br />
Last name:
<input type="text" name="LastName" value="Potter" />
<br />
<input type="submit" value="Submit" />
</form> |