Jquery validation for confirm password 验证两次密码是否一致
<form id="formCheckPassword">
<input type="password" class="form-control" name="password" id="password"/>
<input type="password" class="form-control" name="cfmPassword" id="cfmPassword" />
<input type="submit" value="submit"/>
</form>
$("#formCheckPassword").validate({
rules: {
password: {
required: true,
minlength: 6,
maxlength: 10,
} ,
cfmPassword: {
equalTo: "#password",
minlength: 6,
maxlength: 10
}
},
messages:{
password: {
required:"the password is required"
}
}
});