diff options
author | Helge Mader <ma@dev.tdt.de> | 2021-03-12 10:48:29 +0100 |
---|---|---|
committer | Florian Eckert <fe@dev.tdt.de> | 2021-08-11 08:48:41 +0200 |
commit | 58447640eb4704ce5bed612f84cb86b84afa17fa (patch) | |
tree | 8d02de5d7e507f63b6365c04f4ea342bac637f73 /modules/luci-base/htdocs/luci-static/resources | |
parent | 4314d8f3300825a9c72e249250a60da860da5a7f (diff) |
luci-base: prevent empty field for adding new entry
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Diffstat (limited to 'modules/luci-base/htdocs/luci-static/resources')
-rw-r--r-- | modules/luci-base/htdocs/luci-static/resources/cbi.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/modules/luci-base/htdocs/luci-static/resources/cbi.js b/modules/luci-base/htdocs/luci-static/resources/cbi.js index b66fe684a5..d6020e9d58 100644 --- a/modules/luci-base/htdocs/luci-static/resources/cbi.js +++ b/modules/luci-base/htdocs/luci-static/resources/cbi.js @@ -367,6 +367,17 @@ function cbi_validate_form(form, errmsg) return true; } +function cbi_validate_named_section_add(input) +{ + var button = input.parentNode.parentNode.querySelector('.cbi-button-add'); + if (input.value !== '') { + button.disabled = false; + } + else { + button.disabled = true; + } +} + function cbi_validate_reset(form) { window.setTimeout( |