HTML表单的默认enctype是什么? [英] What is the default enctype for an HTML form?
问题描述
说我有保存一些输入的表格:
Say I've got that form holding some inputs:
<form action="demo_post_enctype.asp" method="post" >
First name: <input type="text" name="fname"><br>
Last name: <input type="text" name="lname"><br>
<input type="submit" value="Submit">
</form>
如果我提交以下表格:浏览器使用哪种编码类型?
If I submit this form: which enctype does the browser use?
是否存在定义明确的默认类型?
还是每个浏览器都选择它自己的enctype(当然是从三个允许的enctype中选择)?
Is there a well-defined default type?
Or does every browser pick it's own enctype (out of the three allowed ones, of course)?
推荐答案
这些属性的默认值默认为
application/x-www-form-urlencoded
状态. enctype属性的默认缺失值也是application/x-www-form-urlencoded
状态. (formenctype属性没有默认的缺失值.)
The invalid value default for these attributes is the
application/x-www-form-urlencoded
state. The missing value default for the enctype attribute is also theapplication/x-www-form-urlencoded
state. (There is no missing value default for the formenctype attribute.)
- HTML 5
此属性指定用于向服务器提交表单的内容类型(当method的值为"post"时). 此属性的默认值为"
application/x-www-form-urlencoded
".值"multipart/form-data
"应与INPUT元素(类型=文件")结合使用.
This attribute specifies the content type used to submit the form to the server (when the value of method is "post"). The default value for this attribute is "
application/x-www-form-urlencoded
". The value "multipart/form-data
" should be used in combination with the INPUT element, type="file".
- HTML 4
这确定用于编码表单内容的机制. 默认为
application/x-www-form-urlencoded
.
This determines the mechanism used to encode the form's contents. It defaults to
application/x-www-form-urlencoded
.
- HTML 3.2
这篇关于HTML表单的默认enctype是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!