|
@@ -259,6 +259,10 @@ export class Interpreter {
|
|
if (element.getAttribute("type") === "checkbox") {
|
|
if (element.getAttribute("type") === "checkbox") {
|
|
// @ts-ignore
|
|
// @ts-ignore
|
|
contents.values[name] = element.checked ? "true" : "false";
|
|
contents.values[name] = element.checked ? "true" : "false";
|
|
|
|
+ } else if (element.getAttribute("type") === "radio") {
|
|
|
|
+ if (element.checked) {
|
|
|
|
+ contents.values[name] = element.value;
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
// @ts-ignore
|
|
// @ts-ignore
|
|
contents.values[name] =
|
|
contents.values[name] =
|
|
@@ -362,9 +366,11 @@ export function serialize_event(event) {
|
|
case "submit": {
|
|
case "submit": {
|
|
let target = event.target;
|
|
let target = event.target;
|
|
let value = target.value ?? target.textContent;
|
|
let value = target.value ?? target.textContent;
|
|
|
|
+
|
|
if (target.type === "checkbox") {
|
|
if (target.type === "checkbox") {
|
|
value = target.checked ? "true" : "false";
|
|
value = target.checked ? "true" : "false";
|
|
}
|
|
}
|
|
|
|
+
|
|
return {
|
|
return {
|
|
value: value,
|
|
value: value,
|
|
values: {},
|
|
values: {},
|