亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

為什么實現不了確認密碼,而有錯誤提示,求告知

<!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">確認密碼</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實驗/用戶登錄/vendor/jquery-1.10.0.js"></script>

<script src="file:///C|/Users/Administrator/Desktop/jQuery實驗/用戶登錄/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


//遠程校驗

/*remote:{

url:"remote.json",

type:"post",

data:{

loginTime:function(){

return +new Date;

}

}

}*/

},

password1:{

required:true,

minlength:2,

maxlength:16

},


//確認密碼

"confirm-password1":{

equalTo:"#password1"

}

},


//信息提示

messages:{

username1:{

required:"必需填寫用戶名",

minlength:"用戶名最少為2位",

maxlength:"用戶名最多為10位",

remote:"用戶名不存在",

rangelength:"用戶名應該在2-10位"

},

password1:{

required:"必需填寫密碼",

minlength:"密碼最少為2位",

maxlength:"密碼最多為16位"

}


"confirm-password1":{

equalTo:"兩次輸入的密碼不一致"

}

}

});

? });

</script>

</body>

</html>


正在回答

1 回答

password1:{
required:"必需填寫密碼",
minlength:"密碼最少為2位",
maxlength:"密碼最多為16位"
},?
//上一行缺少了一個逗號,應該就只有這個錯誤,其他的驗證沒有問題。
"confirm-password1":{
equalTo:"兩次輸入的密碼不一致"
}


0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

為什么實現不了確認密碼,而有錯誤提示,求告知

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號