luci-base: fix button handling for named sections
[project/luci.git] / modules / luci-base / htdocs / luci-static / resources / form.js
index 2d540420bca5f53e1a933c697896e5170661636d..3c538b88ca2e6e2a2fe46cff5380889e99144c8d 100644 (file)
@@ -2259,7 +2259,7 @@ var CBITypedSection = CBIAbstractSection.extend(/** @lends LuCI.form.TypedSectio
 
                        if (this.map.readonly !== true) {
                                ui.addValidator(nameEl, 'uciname', true, function(v) {
-                                       var button = document.querySelector('.cbi-section-create > .cbi-button-add');
+                                       var button = createEl.querySelector('.cbi-section-create > .cbi-button-add');
                                        if (v !== '') {
                                                button.disabled = null;
                                                return true;