Created
May 18, 2014 20:09
-
-
Save jasonhinkle/751a2760c73f7d507cc3 to your computer and use it in GitHub Desktop.
Add onFail event to BootstrapValidator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var validator = $('#myForm).data('bootstrapValidator'); | |
var validatorPrototype = Object.getPrototypeOf(validator); | |
validatorPrototype._real_submit = validatorPrototype._submit; | |
validatorPrototype._submit = function(){ | |
var r = this._real_submit(); | |
if ((!this.isValid()) && 'function' == typeof(this.options.failHandler)){ | |
this.options.failHandler.call(this); | |
} | |
return r; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment