From 101ef29bfdb272531cfbe5221a1584d7bfea887d Mon Sep 17 00:00:00 2001 From: Simon Flowers Date: Tue, 15 Aug 2017 17:19:05 +1200 Subject: [PATCH] Add errorschanged event trigger in showErrors / clearErrors --- js/validator.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/validator.js b/js/validator.js index 6311a22..4eabef1 100644 --- a/js/validator.js +++ b/js/validator.js @@ -268,6 +268,8 @@ && $feedback.removeClass(this.options.feedback.success) && $feedback.addClass(this.options.feedback.error) && $group.removeClass('has-success') + + this.$element.trigger($.Event('errorschanged.bs.validator', {relatedTarget: $el[0]})) } Validator.prototype.clearErrors = function ($el) { @@ -284,6 +286,8 @@ && getValue($el) && $feedback.addClass(this.options.feedback.success) && $group.addClass('has-success') + + this.$element.trigger($.Event('errorschanged.bs.validator', {relatedTarget: $el[0]})) } Validator.prototype.hasErrors = function () {