编辑用户和清除用户是单独的按钮。
那么如何使用以下语句validator.resetForm()清除单击清除按钮时的错误消息;?
function clearUser(){
// Need to clear previous errors here
}
function editUser(){
var validator = $("#editUserForm").validate({
rules: {
userName: "required"
},
errorElement: "span" ,
messages: {
userName: errorMessages.E2
}
});
if(validator.form()){
// form submition code
}
}