luci-base: ui.js: do not save invalid dynlist values
authorJo-Philipp Wich <jo@mein.io>
Tue, 30 Jul 2019 11:33:13 +0000 (13:33 +0200)
committerJo-Philipp Wich <jo@mein.io>
Tue, 30 Jul 2019 11:33:46 +0000 (13:33 +0200)
Fixes: 3880c3f22 ("luci-base: ui.js: save filled out but not added dynlist items on submit")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/htdocs/luci-static/resources/ui.js

index 93e947d01d4feaf5109026cb07ec47e2e3cc44bc..f6a964fb10b4247351fd4c3f74aeeca17694a57e 100644 (file)
@@ -1334,6 +1334,7 @@ var UIDynamicList = UIElement.extend({
                        v.push(items[i].value);
 
                if (input && input.value != null && input.value.match(/\S/) &&
+                   input.classList.contains('cbi-input-invalid') == false &&
                    v.filter(function(s) { return s == input.value }).length == 0)
                        v.push(input.value);