当前位置:软件学堂 > 资讯首页 > 网络编程 > DIV+CSS > 表单中的编码方式enctype

表单中的编码方式enctype

2012/11/21 15:09:48作者:佚名来源:网络

移动端

【实例介绍】

表单中的编码方式enctype

enctype用于设置表单信息提交的编码方式。

【基本语法】

<form enctype="编辑方式">
···
</form>

【语法介绍】

enctype的属性值如表所示。

enctype标记的属性值
属性                                                                     描述
Text/plain                                                    以纯文本的形式传送信息
application/x-wwwcfrom-urlencoded    默认的编码形式
multipart/from-data-mime编码              传文件时必须选择该项

【实例代码】

<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>处理动作</title> </head> <body> <table width="100%" cellspacing="0" cellpadding="0">   <tr>     <td><form action="mailto:weixiao@foxw.com" name="form1" method="post" enctype="application/x-www-form-urlencoded" >     </form></td>   </tr> </table> </body> </html>

【代码分析】

在代码中,加粗的代码标记将表单的编码方式设置为application/x—www—form—urlencoded,即默认的编码形式。

 【素材及源码下载】

请点击:表单中的编码方式enctype 下载本实例相关素材及源码

 

标签: 表单