jQuery验证,将错误消息发送给其他函数

问题描述

| 是否可以将Validate错误消息发送给其他功能? 例如,我有一个通知功能,它显示确定的消息并在(n)秒后消失:
notify(\"My error message\",{ selector: \'#form-notification\' });
如何与此一起使用该通知功能
$(\"#myForm\").validate({
    submitHandler: function(form) {
        var options = { 
            target: \'#save_form\',dataType: \'json\',beforeSubmit: showRequest,success: showResponse 
        }; 
        $(form).ajaxSubmit(options); 
    }
});     
提前致谢。     

解决方法

        您可以使用
showErrors
回调自定义发生错误时发生的情况。加上ѭ3保留默认操作。
$(\"#myForm\").validate({
   showErrors: function(errorMap,errorList) {
        //custom code here

        this.defaultShowErrors();
    }
 });
http://docs.jquery.com/Plugins/Validation/validate