Skip to content

Commit

Permalink
Merge pull request #15 from saicheck2233/new_AddGetDataSupportForRadio
Browse files Browse the repository at this point in the history
Enhancement: Add `getData()` for radio format
  • Loading branch information
saicheck2233 authored Jul 11, 2023
2 parents 9a316bd + 661ff92 commit 7453938
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/js/brutusin-json-forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -938,6 +938,7 @@ if (typeof brutusin === "undefined") {
return object;
}
}

if (!container) {
return null;
} else {
Expand Down Expand Up @@ -1356,6 +1357,14 @@ if (typeof brutusin === "undefined") {
} else {
value = null;
}
} else if (schema.format === "radio") {
value = null;
for (var i = 0; i < input.childElementCount; i++) {
if (input.childNodes[i].tagName === "INPUT" && input.childNodes[i].checked) {
value = input.childNodes[i].value;
break;
}
}
}
} else if (schema.type === "any") {
if (value) {
Expand Down

0 comments on commit 7453938

Please sign in to comment.