Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/88.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
JQuery中连接的错误消息_Jquery_Jsp - Fatal编程技术网

JQuery中连接的错误消息

JQuery中连接的错误消息,jquery,jsp,Jquery,Jsp,我有一个表单,在该表单中,我希望在显示错误消息后立即清除该消息,以便显示另一条消息。我在jsp的顶部有一个errMsg,它总是与我想要显示的消息一起显示。我的验证器如下: $.validator.addMethod("unixFileName", function(value, element){ return /^[a-zA-Z0-9_./#-]+$/.test(value); }); $.validator.addMethod("numericOnly", fun

我有一个表单,在该表单中,我希望在显示错误消息后立即清除该消息,以便显示另一条消息。我在jsp的顶部有一个errMsg,它总是与我想要显示的消息一起显示。我的验证器如下:

 $.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,而是删除了这些标记