Skip to content

Commit 2a67c5e

Browse files
authored
Merge pull request #21 from saicheck2233/new_AddInitialDataSupportForCheckbox
Enhancement: Add initial data support for checkbox
2 parents c78e8fb + 3b8dd17 commit 2a67c5e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/js/brutusin-json-forms.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,8 +407,12 @@ if (typeof brutusin === "undefined") {
407407
label.htmlFor = s.enum[i];
408408
var labelText = document.createTextNode(s.enum[i]);
409409
appendChild(label, labelText);
410-
if (value && s.enum[i] === value) {
411-
checkbox.checked = true;
410+
if (value) {
411+
for (var j = 0; j < value.length; j++) {
412+
if (s.enum[i] === value[j]) {
413+
checkbox.checked = true;
414+
}
415+
}
412416
}
413417
if (s.readOnly) {
414418
checkbox.disabled = true;

0 commit comments

Comments
 (0)