0

在验证引擎中,我试图让错误显示在 javascript 警报框内,而不是在它们旁边的小工具提示中。

$("#main_form").bind("jqv.form.result", function(event, errorFound) {
    if(errorFound)
        alert("There is a problem with your form.\n\nPlease fill out all of the required fields.");
});

这目前正在显示存在错误,但我正在尝试查看是否有办法列出有错误的字段。

谢谢!

4

1 回答 1

0

假设你正在使用这个插件。

这应该为您解决问题:

var errors = []; // initialize the error array

$('.formError').next().each(function(){ 
   errors.push($(this).attr('id'));
});

console.log(errors); //Should give you an array of elements with errors.
于 2013-10-01T21:27:39.663 回答