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實(shí)現(xiàn)的淡入淡出二級(jí)菜單效果代碼
這篇文章主要介紹了jQuery實(shí)現(xiàn)的淡入淡出二級(jí)菜單效果代碼,涉及jQuery中fadeIn及fadeOut的相關(guān)使用技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下2015-09-09
基于jquery的自定義鼠標(biāo)提示效果 jquery.toolTip
看到其它網(wǎng)站A標(biāo)簽title效果,心里癢癢,就想也用到自己網(wǎng)站上。 正好在學(xué)jquery 插件擴(kuò)展,就參照前輩代碼,自己動(dòng)手寫(xiě)了一個(gè)2010-11-11
jQuery操作input type=radio的實(shí)現(xiàn)代碼
jQuery操作input type=radio的實(shí)現(xiàn)代碼,需要的朋友可以參考下2012-06-06
jQuery實(shí)現(xiàn)圖像旋轉(zhuǎn)動(dòng)畫(huà)效果
jquery動(dòng)畫(huà)旋轉(zhuǎn)效果在項(xiàng)目中經(jīng)常遇到這樣的需求,下面小編給大家分享具體實(shí)現(xiàn)代碼,感興趣的朋友一起學(xué)習(xí)吧2016-05-05
jquery獲取并修改觸發(fā)事件的DOM元素示例【基于target 屬性】
這篇文章主要介紹了jquery獲取并修改觸發(fā)事件的DOM元素,結(jié)合實(shí)例形式分析了jQuery基于target 屬性獲取到觸發(fā)該事件的dom并修改的相關(guān)操作技巧,需要的朋友可以參考下2019-10-10
jquery實(shí)現(xiàn)的簡(jiǎn)單輪播圖功能【適合新手】
這篇文章主要介紹了jquery實(shí)現(xiàn)的簡(jiǎn)單輪播圖功能,涉及jQuery基于定時(shí)器的事件響應(yīng)與頁(yè)面元素屬性動(dòng)態(tài)操作相關(guān)實(shí)現(xiàn)技巧,需要的朋友可以參考下2018-08-08
jquery插件開(kāi)發(fā)之實(shí)現(xiàn)jquery手風(fēng)琴功能分享
需要一個(gè)手風(fēng)琴效果,就動(dòng)手寫(xiě)了一個(gè)。其實(shí)有多個(gè)現(xiàn)成的jQuery手風(fēng)琴插件可以用,但對(duì)比了一下,總感覺(jué)有些笨重,還是自己寫(xiě)的脈絡(luò)自己最清楚,擴(kuò)展起來(lái)也更容易些2014-03-03

