Fix fields selector in `Form/Builder/Field/Checkboxes`
authorMatthias Schmidt <gravatronics@live.com>
Fri, 15 Jan 2021 15:02:15 +0000 (16:02 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Fri, 15 Jan 2021 15:02:15 +0000 (16:02 +0100)
ts/WoltLabSuite/Core/Form/Builder/Field/Checkboxes.ts
wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Checkboxes.js

index 33fdfd0cacb39796865fb7c0d55b6584f2069f33..7dd5d3aa6fb7901714d935762186bfd47745fe24 100644 (file)
@@ -32,7 +32,7 @@ class Checkboxes extends Field {
   }
 
   protected _readField(): void {
-    this._fields = Array.from(document.querySelectorAll("input[name=" + this._fieldId + "]"));
+    this._fields = Array.from(document.querySelectorAll(`input[name="${this._fieldId}[]"]`));
   }
 }
 
index 5e131d2a90cc9c75233303709f9ac5a7504d14cd..3234c0db4214974c88a82e5498b31d6f9cf58017 100644 (file)
@@ -26,7 +26,7 @@ define(["require", "exports", "tslib", "./Field", "../../../Core"], function (re
             };
         }
         _readField() {
-            this._fields = Array.from(document.querySelectorAll("input[name=" + this._fieldId + "]"));
+            this._fields = Array.from(document.querySelectorAll(`input[name="${this._fieldId}[]"]`));
         }
     }
     Core.enableLegacyInheritance(Checkboxes);