帝王谷资源网 Design By www.wdxyy.com
1、邮箱的自动验证 只需要type=“email”
2、日期的验证(年月日):type="date"
3、时间的验证(格式:00:00):type="time"
4、数字的验证 (可以向上加 向下减)type="number"
5、月份(--年--月)type="month"
6、周(--年--周)type="week"
7、range(范围0-100) type="range"
8、search type="search"
9、颜色的颜色大全:type="color"
10、url验证 (必须前面有http://---) type="url"
复制代码代码如下:
<form action="Myform.php" id='Myform' method='post'>
邮箱:<input type="email" id='email' required="required" /><br/>
日期:<input type="date" id='date' /><br/>
时间:<input type="time" id='time' /><br/>
数字:<input type="number" id='number' /><br/>
月份:<input type="month" id='month' /><br/>
星期:<input type="week" id='week'/><br/>
range:<input type="range" id='range' /><br/>
search:<input type="search" id='search'/><br/>
颜色:<input type="color" id='color' /><br/>
<input type="text" name="auto" value="" list="movie"/>
<datalist id="movie">
<option>呵呵呵</option>
<option>喂喂喂</option>
<option>嘿嘿嘿</option>
</datalist>
<input type="submit" value="提交"/>
</form>
url:<input type="url" id='url' required="required" name="url" form="Myform" /><br/>
用户名:<input type="text" required="required" placeholder="请输入用户名" form="Myform" autofocus="autofocus" pattern='\w{5}'/>
html新增表单属性
1、required=“required” 验证时 需要必填
2、placeholder="请输入用户名" 默认值,给用户提示的,不是提交到服务器的
3、autofocus="autofocus" 自动聚焦功能,提升用户友好
4、pattern='\w{5}' 在html元素中填写正则表达式
在表单之外也可以提交表单 但是需要 在<input form="Myform"/>中 form=“Myform”需要和form表单中的id的值相等即:<form id="Myform"></form>
自动填充表单:(效果感觉要比下拉列表好多了 而且感觉效果挺好的)list的值要和datalist中的id的值相等这样才能识别到我要显示你的内容:
复制代码代码如下:
<input type="text" name="auto" value="" list="movie"/>
<datalist id="movie">
<option>呵呵呵</option>
<option>喂喂喂</option>
<option>嘿嘿嘿</option>
</datalist>
贴图一张:
![HTML5的表单(绝对特别强大的功能)使用示例](/UploadFiles/2021-03-30/201306201449011.gif?2013520144924)
2、日期的验证(年月日):type="date"
3、时间的验证(格式:00:00):type="time"
4、数字的验证 (可以向上加 向下减)type="number"
5、月份(--年--月)type="month"
6、周(--年--周)type="week"
7、range(范围0-100) type="range"
8、search type="search"
9、颜色的颜色大全:type="color"
10、url验证 (必须前面有http://---) type="url"
复制代码代码如下:
<form action="Myform.php" id='Myform' method='post'>
邮箱:<input type="email" id='email' required="required" /><br/>
日期:<input type="date" id='date' /><br/>
时间:<input type="time" id='time' /><br/>
数字:<input type="number" id='number' /><br/>
月份:<input type="month" id='month' /><br/>
星期:<input type="week" id='week'/><br/>
range:<input type="range" id='range' /><br/>
search:<input type="search" id='search'/><br/>
颜色:<input type="color" id='color' /><br/>
<input type="text" name="auto" value="" list="movie"/>
<datalist id="movie">
<option>呵呵呵</option>
<option>喂喂喂</option>
<option>嘿嘿嘿</option>
</datalist>
<input type="submit" value="提交"/>
</form>
url:<input type="url" id='url' required="required" name="url" form="Myform" /><br/>
用户名:<input type="text" required="required" placeholder="请输入用户名" form="Myform" autofocus="autofocus" pattern='\w{5}'/>
html新增表单属性
1、required=“required” 验证时 需要必填
2、placeholder="请输入用户名" 默认值,给用户提示的,不是提交到服务器的
3、autofocus="autofocus" 自动聚焦功能,提升用户友好
4、pattern='\w{5}' 在html元素中填写正则表达式
在表单之外也可以提交表单 但是需要 在<input form="Myform"/>中 form=“Myform”需要和form表单中的id的值相等即:<form id="Myform"></form>
自动填充表单:(效果感觉要比下拉列表好多了 而且感觉效果挺好的)list的值要和datalist中的id的值相等这样才能识别到我要显示你的内容:
复制代码代码如下:
<input type="text" name="auto" value="" list="movie"/>
<datalist id="movie">
<option>呵呵呵</option>
<option>喂喂喂</option>
<option>嘿嘿嘿</option>
</datalist>
贴图一张:
![HTML5的表单(绝对特别强大的功能)使用示例](/UploadFiles/2021-03-30/201306201449011.gif?2013520144924)
标签:
HTML5,表单
帝王谷资源网 Design By www.wdxyy.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
帝王谷资源网 Design By www.wdxyy.com
暂无评论...
更新日志
2024年07月03日
2024年07月03日
- 原画壁纸及美图第261期,无水印可自取
- 绝区零能量鸣徽有哪些 绝区零能量鸣徽效果介绍
- 绝区零引燃鸣徽有哪些 绝区零引燃鸣徽效果介绍
- 绝区零丽娜技能强度怎么样 丽娜技能加点推荐
- 《七龙珠电光炸裂ZERO》新增角色一览
- 《修仙神诀》游戏下载方法
- 《幻兽帕鲁》恐炬灵种族值介绍
- 胡又天《她说HQ》头版限量[低速原抓WAV+CUE]
- 韵味悠扬如诗如画《草原的骄傲3CD》DTS[WAV]
- 雨果唱片《秦王点兵LP1630》WAV+CUE
- 《战意》官宣上架WeGame平台 国内首个腾讯网易双服共营游戏
- 卡普空收购中国台湾CG工作室 曾参与《龙之信条2》《生化危机8:村庄》开发
- 韩妹《妮姬:胜利女神》COS图赏:身材优势尽显
- 《张韶涵 华语流行 17CD 全球最全最佳版》[WAV+CUE][5.6GB]
- 任素汐《无损音乐合集》2016-2024[FLAC/分轨][420MB]