Latest

recent

HTML form enctype Attribute

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

<a enctype="text/plain">

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>
HTML form enctype Attribute Reviewed by 1000sourcecodes on 03:53 Rating: 5
Powered by Blogger.