当前位置: 首页 > 网络学院 > 客户端脚本教程 > HTML DOM > HTML DOM enctype 属性

HTML DOM
DOM 介绍
HTML DOM 举例
DOM 参考
DOM 摘要
HTML DOM 实例
DOM Anchor
DOM Applet
DOM Area
DOM Base 对象
DOM Basefont对象
DOM Body 对象
DOM Document 对象
DOM 事件
DOM Form 对象
DOM Frame 对象
DOM Frameset 对象
DOM History
DOM Iframe 对象
DOM Image 对象
HTML DOM Button对象

HTML DOM enctype 属性


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 383 ::
收藏到网摘: n/a

Definition and Usage
定义与用法

The enctype property sets or returns the MIME type used to encode the content of the form.
enctype属性可设置或返回表单内容的MIMIE类型

If the form has no enctype attribute, the default value when submitting text is "application/x-www-form-urlencoded".
如果表单没有enctype属性,默认的值为:"application/x-www-form-urlencoded".

When input type is "file", the value should be "multipart/form-data".
当内容为“文件”,值应该为"multipart/form-data"

Syntax 语法

formObject.encoding=encoding


Example 举例

The following example returns the encoding type of the form:
下面的举例将返回表单的encoding类型:

<html>
<head>
<script type="text/javascript">
function showEnctype()
{
var x=document.getElementById("myForm")
alert(x.enctype)
}
</script>
</head>
<body>
<form id="myForm" enctype="application/x-www-form-urlencoded">
Name: <input type="text" value="Mickey Mouse" />
<input type="button" onclick="showEnctype()"
value="Show enctype" />
</form>
</body>
</html>


演练

Get the encoding type of a form
得到表单的encoding类型

评论 (0) All

登陆 | 还没注册?