From: Jo-Philipp Wich Date: Tue, 30 Jul 2019 11:33:13 +0000 (+0200) Subject: luci-base: ui.js: do not save invalid dynlist values X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=8a947ea550f7ab1cec89d1b1a8acf57be55e7199;p=project%2Fluci.git luci-base: ui.js: do not save invalid dynlist values Fixes: 3880c3f22 ("luci-base: ui.js: save filled out but not added dynlist items on submit") Signed-off-by: Jo-Philipp Wich --- diff --git a/modules/luci-base/htdocs/luci-static/resources/ui.js b/modules/luci-base/htdocs/luci-static/resources/ui.js index 93e947d01d..f6a964fb10 100644 --- a/modules/luci-base/htdocs/luci-static/resources/ui.js +++ b/modules/luci-base/htdocs/luci-static/resources/ui.js @@ -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);