為什么實(shí)現(xiàn)不了確認(rèn)密碼,而有錯(cuò)誤提示,求告知
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>jQuery Validation ?插件</title>
<link rel="stylesheet" href="style.css">>
</head>
<body>
<form id="demoForm">
<fieldset>
<legend>用戶登錄</legend>
<p>
<label for="username">用戶名</label>
<input type="text" name="username1" id="username"/>
</p>
<p>
<label for="password">密碼</label>
<input type="password" id="password" name="password1">
</p>
<p>
<label for="confirm-password">確認(rèn)密碼</label>
<input type="password" id="confirm-password" name="confirm-password1">
</p>
<p>
<input type="submit" name="登錄"/>
</p>
</fieldset>
</form>
<script src="file:///C|/Users/Administrator/Desktop/jQuery實(shí)驗(yàn)/用戶登錄/vendor/jquery-1.10.0.js"></script>
<script src="file:///C|/Users/Administrator/Desktop/jQuery實(shí)驗(yàn)/用戶登錄/vendor/jquery.validate-1.13.1.js"></script>
<script>
$(document).ready(function(){
$("#demoForm").validate({
debug:true,
rules:{
username1:{
required:true,
//minlength:2,
//maxlength:10,
//rangelength:[2,10],
//digits:true
//遠(yuǎn)程校驗(yàn)
/*remote:{
url:"remote.json",
type:"post",
data:{
loginTime:function(){
return +new Date;
}
}
}*/
},
password1:{
required:true,
minlength:2,
maxlength:16
},
//確認(rèn)密碼
"confirm-password1":{
equalTo:"#password1"
}
},
//信息提示
messages:{
username1:{
required:"必需填寫用戶名",
minlength:"用戶名最少為2位",
maxlength:"用戶名最多為10位",
remote:"用戶名不存在",
rangelength:"用戶名應(yīng)該在2-10位"
},
password1:{
required:"必需填寫密碼",
minlength:"密碼最少為2位",
maxlength:"密碼最多為16位"
}
"confirm-password1":{
equalTo:"兩次輸入的密碼不一致"
}
}
});
? });
</script>
</body>
</html>
2018-08-31