の後に発生するイベントはありますかshowErrors
。
すべてのコールバック関数のドキュメントを参照してください:
http://docs.jquery.com/Plugins/Validation/validate#toptions
または、オーバーライドするのではなく、この関数を拡張する方法があります。
いいえ。カスタム コールバック関数 (オーバーライド) を使用するのが、これを行う一般的な方法です。
プラグインの中を見る; カスタムコールバック関数が宣言されているかどうかを確認し、デフォルトの代わりにあなたのものを使用します...
// http://docs.jquery.com/Plugins/Validation/Validator/showErrors
showErrors: function( errors ) {
if ( errors ) {
// add items to error list and map
$.extend( this.errorMap, errors );
this.errorList = [];
for ( var name in errors ) {
this.errorList.push({
message: errors[name],
element: this.findByName(name)[0]
});
}
// remove items from success list
this.successList = $.grep( this.successList, function( element ) {
return !(element.name in errors);
});
}
if ( this.settings.showErrors ) {
this.settings.showErrors.call( this, this.errorMap, this.errorList );
} else {
this.defaultShowErrors();
}
}
defaultShowErrors: function() {
var i, elements;
for ( i = 0; this.errorList[i]; i++ ) {
var error = this.errorList[i];
if ( this.settings.highlight ) {
this.settings.highlight.call( this, error.element, this.settings.errorClass, this.settings.validClass );
}
this.showLabel( error.element, error.message );
}
if ( this.errorList.length ) {
this.toShow = this.toShow.add( this.containers );
}
if ( this.settings.success ) {
for ( i = 0; this.successList[i]; i++ ) {
this.showLabel( this.successList[i] );
}
}
if ( this.settings.unhighlight ) {
for ( i = 0, elements = this.validElements(); elements[i]; i++ ) {
this.settings.unhighlight.call( this, elements[i], this.settings.errorClass, this.settings.validClass );
}
}
this.toHide = this.toHide.not( this.toShow );
this.hideErrors();
this.addWrapper( this.toShow ).show();
}