说我有保存一些输入的表格:
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 the application/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是什么?
发布评论