HTML <input> Tag with the 'formenctype' Attribute

<form>

<input type="submit" value="Submit" formaction="http://www.htmlcodes.ws/resources/html-forms-action.cfm" formenctype="application/x-www-form-urlencoded">

</form>

In the above example we add the formenctype attribute to an <input> element.

The formenctype attribute allows you to specify the content type used to encode the form data set when it's submitted to the server.

Possible values:

  • application/x-www-form-urlencoded (default)
  • multipart/form-data (use this when uploading files)
  • text/plain (use this when uploading files)

The W3C says:

If the element is a submit button and has a formenctype attribute, then the element's enctype is that attribute's state; otherwise, it is the form owner's enctype attribute's state.