web/elements: fix checkbox not being sent correctly

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-04-09 11:58:52 +02:00
parent 232a5a8ad0
commit 5a5a32ff83
1 changed files with 2 additions and 0 deletions

View File

@ -115,6 +115,8 @@ export class Form<T> extends LitElement {
json[element.name] = values; json[element.name] = values;
} else if (element.tagName.toLowerCase() === "input" && element.type === "date") { } else if (element.tagName.toLowerCase() === "input" && element.type === "date") {
json[element.name] = element.valueAsDate; json[element.name] = element.valueAsDate;
} else if (element.tagName.toLowerCase() === "input" && element.type === "checkbox") {
json[element.name] = element.checked;
} else { } else {
for (let v = 0; v < values.length; v++) { for (let v = 0; v < values.length; v++) {
form._addSerializedElement(json, element.name, values[v]); form._addSerializedElement(json, element.name, values[v]);