HTML button formenctype property
Examples
Submit a form with two buttons (with a different encoding), the first submit button to submit the form using the default character encoding data, the second submit button does not submit the form data using character encoding:
<form action="demo_post_enctype.asp" method="post">
Name: <input type="text" name="fname" value="Stale Refsnes"><br>
<button type="submit" >使用编码提交</button>
<button type="submit" formenctype="text/plain">不使用编码提交</button>
</form>
Name: <input type="text" name="fname" value="Stale Refsnes"><br>
<button type="submit" >使用编码提交</button>
<button type="submit" formenctype="text/plain">不使用编码提交</button>
</form>
try it"
Browser Support
Internet Explorer 10, Firefox, Opera, Chrome, and Safari support formenctype property.
Note: Internet Explorer 9 and earlier versions do not support IE formenctype property.
Definition and Usage
formenctype property overrides form element's enctype attribute.
This attribute type = "submit" used in conjunction.
HTML 4.01 and HTML 5 differences between
formenctype property is HTML 5 new property.
grammar
<button type="submit" formenctype=" value ">
Property Value
value | description |
---|---|
application / x-www-form-urlencoded | Before it is sent to all the characters are encoded (default). |
multipart / form-data | Not the character encoding. When using a file upload form control, this value is required. |
text / plain | Converting spaces as "+" symbol, but does not encode special characters. |