jQuery validate验证表单隐藏域
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);
}
}
});
};