更新时间:2021-07-10 23:27:11
我不会质疑与此有关的可用性问题:).
通过使用invalidHandler
选项进行验证,确实可以实现:
I will not question the usability issues around this :).
This is indeed possible by using the invalidHandler
option for validate:
$("#test-form").validate({
invalidHandler: function() {
/* Allow the user to see the error messages before submitting: */
window.setTimeout(function() {
$("#test-form")[0].submit();
}, 1000);
}
});
这里是一个示例: http://jsfiddle.net/ghDbd/