JQuery中连接的错误消息
我有一个表单,在该表单中,我希望在显示错误消息后立即清除该消息,以便显示另一条消息。我在jsp的顶部有一个errMsg,它总是与我想要显示的消息一起显示。我的验证器如下:JQuery中连接的错误消息,jquery,jsp,Jquery,Jsp,我有一个表单,在该表单中,我希望在显示错误消息后立即清除该消息,以便显示另一条消息。我在jsp的顶部有一个errMsg,它总是与我想要显示的消息一起显示。我的验证器如下: $.validator.addMethod("unixFileName", function(value, element){ return /^[a-zA-Z0-9_./#-]+$/.test(value); }); $.validator.addMethod("numericOnly", fun
$.validator.addMethod("unixFileName", function(value, element){
return /^[a-zA-Z0-9_./#-]+$/.test(value);
});
$.validator.addMethod("numericOnly", function(value, element){
return /^[0-9]+$/.test(value);
});
var container = $('div.errMsg');
$("#outputFileSplitForm").validate({
errorContainer : container,
errorLabelContainer: container,
rules:{
fileName:{unixFileName: true},
groups:{numericOnly: true},
recordsPerFile:{numericOnly: true}
},
messages:{
fileName:{unixFileName: "Please enter valid Unix file path"},
groups:{numericOnly: "Please enter a numeric value"},
recordsPerFile:{numericOnly: "Please enter a numeric value"}
}
});
当我尝试在组中输入除数字以外的任何内容时,它会显示消息“请输入数值”,但当我单击其他记录文件时,它会连接消息“请输入数值请输入数值”。我一次只想看到一条消息。
我尝试使用validator.resetForm()。它不起作用。请帮忙 在这个场景中,我没有看到java或spring,而是删除了这些标记