From: Matthias Schmidt Date: Fri, 15 Jan 2021 15:02:15 +0000 (+0100) Subject: Fix fields selector in `Form/Builder/Field/Checkboxes` X-Git-Tag: 5.4.0_Alpha_1~441 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=59a2f23577059bc82d52d04185af460e34f33951;p=GitHub%2FWoltLab%2FWCF.git Fix fields selector in `Form/Builder/Field/Checkboxes` --- diff --git a/ts/WoltLabSuite/Core/Form/Builder/Field/Checkboxes.ts b/ts/WoltLabSuite/Core/Form/Builder/Field/Checkboxes.ts index 33fdfd0cac..7dd5d3aa6f 100644 --- a/ts/WoltLabSuite/Core/Form/Builder/Field/Checkboxes.ts +++ b/ts/WoltLabSuite/Core/Form/Builder/Field/Checkboxes.ts @@ -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}[]"]`)); } } diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Checkboxes.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Checkboxes.js index 5e131d2a90..3234c0db42 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Checkboxes.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Checkboxes.js @@ -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);