Revert the checked state of a checkbox if an error occured

This commit is contained in:
Gregoo 2025-02-04 23:03:56 +01:00
parent 6eb0964322
commit b6d69e0f10
2 changed files with 8 additions and 0 deletions

View File

@ -22,6 +22,9 @@
### Code ### Code
- Changer
- Revert the checked state of a checkbox if an error occured
- Form - Form
- Migrate missing input fields to BrickChanger - Migrate missing input fields to BrickChanger

View File

@ -174,6 +174,11 @@ class BrickChanger {
console.log(error.message); console.log(error.message);
this.status_error(error.message); this.status_error(error.message);
// Reverse the checked state
if (this.html_type == "checkbox") {
this.html_element.checked = !this.html_element.checked;
}
} }
} }
} }