html表单所有类型
2016-09-06 01:50
309 查看
<span style="font-size:24px;"><!DOCTYPE html> <!-- To change this license header, choose License Headers in Project Properties. To change this template file, choose Tools | Templates and open the template in the editor. --> <html> <head> <title>表单输入框的类型</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width"> </head> <body> <!--对于整个表单来说有很多浏览器自带的属性我们在写网站的时候需要去除默认的,写自己的一些属性 + novalidate为tue表示整个表单将不采用默认验证 + enctype 设置是表示数据发送到服务器之前如何对表单数据进行编码(上传文件的表单使用multipart/form-data + text/plain只对特殊的字符编码 + application/x-www-form-urlencoded对所有的进行编码) --> <form name="inputTypeForm" id="typeForm" novalidate="true" enctype="text/plain"> <!--最常用的输入框的类型 + autofocus属性用于表单自动获得焦点 + pattern支持表单自定义正则表达式验证 + required必填项用required控制--> <input type="text" name="name" autofocus="autofocus" pattern="[A-z]{3}" required="required"> <!--主要用于输入密码会隐藏显示的内容--> <input type="password" name="pass"> <!--显示button按钮--> <input type="button" name="确定"> <!--表单的提交按钮 + formnovalidate为true时是对该项免去浏览器默认的验证 + formaction存在值得时候是对当前的表单重新选择提交路径--> <input type="submit" value="提交" formnovalidate="true" formaction="demo_admin.asp" > <!--重置表单的按钮--> <input type="reset" value="重置"> <!--单选按钮让用户只选其一--> <input type="radio" name="sex" value="man"> <input type="radio" name="sex" value="woman"> <!--表单的多选框--> <input type="checkbox" name="white" value="white"> <input type="checkbox" name="blue" value="blue"> <!--用于定义隐藏字段--> <input type="hidden" name="city" value="city"> <!--用于用户选择文件上传 + multiple 支持多选、默认情况下是单选--> <input type="file" multiple="multiple"> <!--不提倡使用type=image作为表单的提交按钮要结合alt src使用。提交时会将按钮的x/y坐标提交上去 + width、height是css3新加的属性 --> <input type="image" src="http://demo.jb51.net/js/2015/jquery_lunbo/images/4.jpg" alt="submit" width="99" height="99"> <!--新增控件类型 下面是html5新加的表单类型,使得html更加的强大 可以设置最小值、最大值和每次点击跳的步数--> <input type="number" min="0" max="10" step="3"> <!--自带的邮箱输入框已经做好了验证--> <input type="email" placeholder="请输入邮箱"> <!--如果想要输入一个连接通过url来控制--> <input type="url" placeholder="请输入链接"> <!--可以选择颜色--> <input type="color" placeholder="请选择颜色"> <!--可以选择范围--> <input type="range" placeholder="请选择范围"> <!--日期的选择当然时间这块的类型有点多 date/month/week/time/datetime--> <input type="date" placeholder="请选择时间"> <!--html5新加的列表标签、更形象化 相当于自己封装了一个select--> <datalist id="url_list"> <option label="W3Schools" value="http://www.w3school.com.cn" /> <option label="Google" value="http://www.google.com" /> <option label="Microsoft" value="http://www.microsoft.com" /> </datalist> </form> <!--在form表单之外但是一样是属于id为typeForm的表单 + 但所属为多个form的时候各个id用空格分割开--> <input type="text" name="nickname" form="typeForm"> </body> </html></span>
相关文章推荐
- 怎么把DHTMLX的ToolBar里的input变成下拉选项框的
- DHTMLX做一个Grid列表显示数据
- 移除utf8+BOM格式的html文件头有一行空格的问题
- HTML
- HTML常用标签及属性
- HTML框架标签
- html之储存
- 关于html 头部meta标签。
- HTML链接标签
- HTML自定义链接。实现段落导标题
- HTML语言中符号的字符编码
- HTML基本规则
- 基于poi3.14做的excel(.xlsx)转html的功能
- HTML基础
- 你应该知道的HTML 5五大特性
- 文本标记
- html格式标记
- html的空格显示距离问题
- input框前追加图片
- TextMate 编辑 HTML 使用的快捷键记录