HTML form enctype Attribute
HTML <form> tag
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="Peter" />
<br />
Last name:
<input type="text" name="LastName" value="Griffin" />
<br />
<input type="submit" value="Submit" />
</form>
|
Try-It-Yourself Demos
form
enctype attribute example
Specify the encoding type used on the sent form data.
HTML <form> tag
Whether you're new to XML or already an advanced user, the user-friendly views
and powerful entry helpers, wizards, and debuggers in XMLSpy are designed to
meet your XML and Web services development needs from start to finish.
- XML editor
- Graphical XML Schema / DTD editors
- XSLT 1.0/2.0 editor, debugger, profiler
- XQuery editor, debugger, profiler
- Support for Office Open XML (OOXML)
- Graphical WSDL editor & SOAP debugger
- Java, C#, C++ code generation
- And much more!
Download a fully functional free 30-day trial today!
|