Advertisement
Home Open Editor ❯

HTML <input> formenctype Attribute

Example

<form action="action.php">
  <label for="fname">First name:</label>
  <input type="text" id="fname" name="fname">
  
  <label for="lname">Last name:</label>
  <input type="text" id="lname" name="lname">
  
  <input type="submit" value="Submit">
  <input type="submit" formenctype="text/plain" value="Submit as text/plain">
</form>

Try this code ❯

Meaning

The formenctype attribute indicates how form data should be encoded before being sent to the server.

The formenctype attribute overrides the enctype attribute of the <form> element.


Standard Syntax

HTML: <input formenctype="application/x-www-form-urlencoded|multipart/form-data|text/plain">

XHTML: <input formenctype="application/x-www-form-urlencoded|multipart/form-data|text/plain" />


Advertisement

Attribute Values

Value Description
application/x-www-form-urlencoded (Default) All characters will be encoded before sending data.
multipart/form-data This value is necessary if the upload a file through the form. (img, video, etc...)
text/plain Sending data without any encoding. (Not recommended)
Home Open Editor ❯
Advertisement