jquery插件validate驗(yàn)證的小例子
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<!-- 注意引用順序-->
<script src="Jquery1.7.js" type="text/javascript"></script>
<script src="jquery.validate.js" type="text/javascript"></script>
<script src="messages_cn.js" type="text/javascript"></script>
<script type="text/javascript">
// $(function () {
// $('#a').validate({
// rules: {
// username: { required: true, minlength: 6, maxlength: 12 },
// email: { required: true, email: true }
// },
// errorshow: function (error, element) {
// error.appendTo(element.siblings('span'));
// }
// })
// })
$(function () {
$('#a').validate({
rules: {
username: { required: true, minlength: 6, maxlength: 12 },
email: { required: true, email: true },
pwd: { required: true, rangelength:[6,6] },
again: { required: true, equalTo: ($('#aa')) }, //這里一定是id
birthday:{date:true},
blood:{digits:true}
},
errorshow: function (error, element) {
error.appendTo(element.siblings('span'));
}
})
})
</script>
</head>
<body>
<form id="a">
<div>
用戶名:<input type="text" name="username" /><span style="width:100px"></span>
<br />
郵箱:<input type="text" name="email" /><span style="width:100px"></span>
<br />
密碼:<input type="text" name="pwd" /><span style="width:100px" id="aa"></span>
<br />
確認(rèn)密碼:<input type="text" name="again" /><span style="width:100px"></span>
<br />
生日:<input type="text" name="birthday" /><span style="width:100px"></span>
<br />
血壓:<input type="text" name="blood" /><span style="width:100px"></span>
</div>
</form>
</body>
</html>
- jQuery驗(yàn)證插件 Validate詳解
- JQuery擴(kuò)展插件Validate—4設(shè)置錯(cuò)誤提示的樣式
- JQuery擴(kuò)展插件Validate—6 radio、checkbox、select的驗(yàn)證
- JQuery擴(kuò)展插件Validate 5添加自定義驗(yàn)證方法
- jValidate 基于jQuery的表單驗(yàn)證插件
- jQuery驗(yàn)證插件validate使用方法詳解
- jQuery插件Validate實(shí)現(xiàn)自定義校驗(yàn)結(jié)果樣式
- jQuery插件Validate實(shí)現(xiàn)自定義表單驗(yàn)證
- Jquery插件 easyUI屬性匯總
- Jquery插件之多圖片異步上傳
- jQuery Dialog 彈出層對(duì)話框插件
- 強(qiáng)烈推薦240多個(gè)jQuery插件提供下載
- 分享20多個(gè)很棒的jQuery 文件上傳插件或教程
- jQuery validate插件功能與用法詳解
相關(guān)文章
詳解Jquery EasyUI tree 的異步加載(遍歷指定文件夾,根據(jù)文件夾內(nèi)的文件生成tree)
本篇文章主要介紹了Jquery EasyUI tree 的異步加載,可以實(shí)現(xiàn)遍歷指定文件夾,根據(jù)文件夾內(nèi)的文件生成tree,有興趣的可以了解一下。2017-02-02setInterval與clearInterval的使用示例代碼
本篇主要是對(duì)setInterval與clearInterval的使用示例代碼進(jìn)行了介紹,需要的朋友可以過來參考下,希望對(duì)大家有所幫助2014-01-01使用jQuery將多條數(shù)據(jù)插入模態(tài)框的實(shí)現(xiàn)代碼
這篇文章主要介紹了使用jQuery將多條數(shù)據(jù)插入模態(tài)框的方法,很簡單,很實(shí)用,需要的朋友可以參考下2014-10-10ASP.NET jQuery 實(shí)例14 在ASP.NET form中校驗(yàn)時(shí)間范圍
這節(jié)主要講如何用jQuery校驗(yàn)表單時(shí)間范圍,時(shí)間控件用到了jQuery-ui2012-02-02jQuery get和post 方法傳值注意事項(xiàng)
用 jQuery 的都知道,jQuery 的 get 和 post 方法有三個(gè)參數(shù):地址,數(shù)據(jù) 和 回調(diào)函數(shù),但我們知道地址也可以跟隨數(shù)據(jù)的(形如:get_data.php?v1=1&v2=2),而且第二個(gè)參數(shù)可以省略,即第二個(gè)參數(shù)可以直接寫回調(diào)函數(shù),那么數(shù)據(jù)寫在地址后面和寫在 data 參數(shù)里有什么區(qū)別呢?2009-11-11javascript與jquery中跳出循環(huán)的區(qū)別總結(jié)
本文是對(duì)javascript與jquery中跳出循環(huán)的區(qū)別進(jìn)行了詳細(xì)的總結(jié)介紹,需要的朋友可以過來參考下,希望對(duì)大家有所幫助2013-11-11jQuery中用on綁定事件時(shí)需注意的事項(xiàng)
本篇文章主要介紹了jQuery中用on綁定事件時(shí)需注意的事項(xiàng),具有很好的參考價(jià)值。下面跟著小編一起來看下吧2017-03-03