mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-06 03:45:26 +00:00
Fix validation issues
This commit is contained in:
parent
2385542b89
commit
d73cae36ad
2 changed files with 17 additions and 0 deletions
10
httpdocs/js/validator.js
vendored
10
httpdocs/js/validator.js
vendored
|
|
@ -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/>')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue