tztzyzyz 2020-07-20
function validInfoForm(){
return $("#form_password").validate({
ignore : "",//验证隐藏域,解决切换标签后隐藏域无法验证问题
rules: {
oldPassword: {
required: !0
},
newPassword: {
required: !0,
isPwd : true,
notEqualTo: $("#oldPassword")
},
surePassword:{
required: !0,
equalTo: $("#newPassword")
}
},
messages : {
oldPassword : {
required : e + "原密码不能为空"
},
newPassword : {
required : e + "新密码不能为空"
},
surePassword : {
required : e + "确认密码不能为空",
equalTo: e + "新密码和确认密码不一致"
}
},
errorPlacement: function (error, element) {//修改提示位置
if(element.is("input[name=‘newPassword‘]")){
error.appendTo($(".col-xs-12-padding"));
}else{
error.insertAfter(element);
}
}
});
};