HTML表单的默认enctype是什么?

编程入门 行业动态 更新时间:2024-10-27 06:28:36
本文介绍了HTML表单的默认enctype是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

说我有保存一些输入的表格:

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是什么?

本文发布于:2023-10-12 02:40:32,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1483531.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:表单   HTML   enctype

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!