html5表单验证(Bootstrap)
html5表单验证(Bootstrap)
邮箱验证:
<input name="email" type="text" placeholder="必填项" class="input-xlarge" required pattern="^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$"
title="邮箱正确格式:xxx@xxx.xxx">
密码验证:
<div class="control-group">
<label class="control-label">
密码</label>
<div class="controls">
<input id="pwd" name="pwd" type="password" placeholder="必填项" class="input-xlarge"
required onchange="checkPasswords()">
</div>
</div>
<div class="control-group">
<label class="control-label">
确认密码</label>
<div class="controls">
<input id="pwd1" name="pwd1" type="password" placeholder="必填项" class="input-xlarge"
required onchange="checkPasswords()">
</div>
</div>
验证方法:
<script>
function checkPasswords() {
var passl = document.getElementById("pwd");
var pass2 = document.getElementById("pwd1");
if (passl.value != pass2.value)
passl.setCustomValidity("两次密码必须输入一致!");
else
passl.setCustomValidity('');
}
function check() {
document.getElementById('ok').disabled = 'disabled';
}
</script>
html5表单验证(Bootstrap)的更多相关文章
- html5表单验证
表单验证为终端用户检测无效的数据并标记这些错误,是一种用户体验的优化. 下面展现浏览器自带的验证功能也可在移动端中查看: HTML部分: <!DOCTYPE html> <html ...
- 实现跨浏览器html5表单验证
div:nth-of-type(odd){ float: left; clear: left; } .origin-effect > div:nth-of-type(even){ float: ...
- jQuery html5Validate基于HTML5表单验证插件
更新于2016-02-25 前面提到的新版目前线上已经可以访问: http://mp.gtimg.cn/old_mp/assets/js/common/ui/Validate.js demo体验狠狠地 ...
- HTML5表单验证(4个实用的表单美化案例)
multipart/form-data 在使用包含文件上传控件的表单时,必须使用autocomplete="on" 自动补全功能novalidate 不验证 <form en ...
- HTML5 web Form表单验证实例
HTML5 web Form 的开发实例! index.html <!DOCTYPE html> <html> <head> <meta charset=&q ...
- [H5表单]html5自带表单验证体验优化及提示气泡修改
慕课网之前录制的视频,js/jquery各种宽高的理解和应用,最近终于上线了.还有一个html5左侧导航没有上线!最近慕课网系列课程让我录制一个html5表单验证的课程.今天就稍微说一下表单验证!另外 ...
- HTML5中表单验证的8种方法(转)
在深人探讨表单验证之前,让我们先思考一下表单验证的真实含义.就其核心而言,表单验证是一套系统,它为终端用户检测无效的控件数据并标记这些错误.换言之,表单验证就是在表单提交服务器前对其进行一系列的检查并 ...
- AngularJS复习------表单验证
在AngularJS中能够将HTML5表单验证功能同自己的验证指令结合起来使用,这里介绍使用的核心功能. 使用表单验证,首先要确保表单的每个控件都有name属性 如果想要屏蔽浏览器对表单的默认验证行为 ...
- AangularJS的表单验证
Angular能够将HTML5表单验证功能同它自己的验证指令结合起来使用 Angular提供了很多表单验证指令: 1. 必填项:验证表单输入是否填写,只需在html标签上标记required 如: ...
随机推荐
- SpringMVC框架入门配置 IDEA下搭建Maven项目(zz)
SpringMVC框架入门配置 IDEA下搭建Maven项目 这个不错哦 http://www.cnblogs.com/qixiaoyizhan/p/5819392.html
- rosbag使用--记录深度相机数据
首先看一下教程: http://wiki.ros.org/openni_launch/Tutorials/BagRecordingPlayback 知道了rosbag如何进行使用记录深度数据 但是按照 ...
- Servlet response原理
首先web服务器 接受到http请求后转交给相应的servlet进行处理这个过程可以他通过配置web.xml来进行确定,然后web服务器将相应的信息封装到request和response对象,由相应的 ...
- 安装mezzanine时报:storing debug log for failure【已解决】
同时还提示: bz2 module is not found(貌似) 解决方法: 1.重新安装python wget http://bzip.org/1.0.6/bzip2-1.0.6.tar.gz ...
- 百度之星资格赛 2016 Problem 1002
本文链接:http://www.cnblogs.com/Ash-ly/p/5494623.html 题意: 度熊面前有一个全是由1构成的字符串,被称为全1序列.你可以合并任意相邻的两个1,从而形成一个 ...
- pyinstaller对多进程程序的打包
在使用python的第三方库pyinstaller对多进程程序进行打包时,程序不能正常的运行,但是后台却有多个进程一直在使用资源. 解决方法很简单,在if __name__ == '__main__' ...
- 并查集+背包 【CF741B】 Arpa's weak amphitheater and Mehrdad's valuable Hoses
Descirption 有n个人,每个人都有颜值bi与体重wi.剧场的容量为W.有m条关系,xi与yi表示xi和yi是好朋友,在一个小组. 每个小组要么全部参加舞会,要么参加人数不能超过1人. 问保证 ...
- NGUI_Sprites
一.UI Sprites 控件: Sprites控件是NGUI的基础控件,几乎可以这么说所有的控件都可以基于Sprites控件添加 Box Collider然后进行附加相关的脚本组件来达到想要的插件效 ...
- 网站模糊测试爆破工具Wfuzz
网站模糊测试爆破工具Wfuzz 模糊测试爆破使用模糊测试的方式对HTTP请求中的各个参数同时进行猜测爆破.例如,渗透测试人员可以采用不同的HTTP请求方式来访问由字典生成的网页路径,以判断网页目录 ...
- 【暴力】洛谷 P2038 NOIP2014提高组 day2 T1 无线网络发射器选址
暴力枚举. #include<cstdio> #include<algorithm> using namespace std; ][],d,n,x,y,z,num,ans=-; ...