Fix validation issues

This commit is contained in:
emanuele-f 2017-01-18 11:56:30 +01:00
parent 2385542b89
commit d73cae36ad
2 changed files with 17 additions and 0 deletions

View file

@ -172,6 +172,7 @@
Validator.prototype.showErrors = function ($el) {
var method = this.options.html ? 'html' : 'text'
var self = this
this.defer($el, function () {
var $group = $el.closest('.form-group')
@ -179,6 +180,15 @@
var $feedback = $group.find('.form-control-feedback')
var errors = $el.data('bs.validator.errors')
/* BEGIN ntopng fix */
if (typeof(errors) === "undefined") {
/* this happens when a field is removed from the form */
errors = []
self.clearErrors($el)
self.toggleSubmit()
}
/* END ntopng fix */
if (!errors.length) return
errors = $('<ul/>')