The Current State of HTML5 Forms

The formenctype Attribute

<form enctype="multipart/form-data">
  <input type=submit value=Submit 
     formenctype="application/x-www-form-urlencoded">
</form>

Live Demo

Firefox
4+
Safari
5.2+
Safari Mobile
5+
Chrome
10
Opera
10.6+
IE
10+
Android
4.0
Supported Supported Supported Supported Supported Supported Supported

The Low Down

The formenctype attribute can force a form to submit the data in the specified encoding rather than the encoding specified in the form element when submitted as "post".

  • Valid as an attribute of elements that can submit a form, including <input type=submit> and <input type=image> and <button>.
  • Possible values include
    • the default of "application/x-www-form-urlencoded" which encodes special chars in the URL to ASCII HEX values and spaces to '+',
    • no encoding with multipart/form-data, and
    • text/plain which only converts spaces to +, and leaves other characters as is.
  • Setting a value other than typical encoding types yields inconsistent results.