From 8a2f1c76b5fbc340fe9c4cbef27cca6ba9c83c87 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Fri, 13 Sep 2019 14:31:00 +0200 Subject: [PATCH] luci-base: cbi.js: save filled out but not added dynlist items on apply Fixes: #2938 Signed-off-by: Jo-Philipp Wich --- modules/luci-base/htdocs/luci-static/resources/cbi.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/luci-base/htdocs/luci-static/resources/cbi.js b/modules/luci-base/htdocs/luci-static/resources/cbi.js index 400d25e09..d71a315da 100644 --- a/modules/luci-base/htdocs/luci-static/resources/cbi.js +++ b/modules/luci-base/htdocs/luci-static/resources/cbi.js @@ -1207,6 +1207,11 @@ function cbi_submit(elem, name, value, action) form.appendChild(hidden); } + var dynadd = form.querySelectorAll('input[data-dynlist-add="true"]'); + for (var i = 0; i < dynadd.length; i++) + if (dynadd[i].value != '') + dynadd[i].nextElementSibling.click(); + form.submit(); return true; } -- 2.25.1