[GH-ISSUE #1654] Checkbox example? #1407

Open
opened 2026-02-28 01:29:56 +03:00 by kerem · 1 comment
Owner

Originally created by @Dario-Ciceri on GitHub (Sep 4, 2023).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1654

Hi, could you please provide a working checkbox example?
I tried many examples, included yours but checkbox value is always ""

Thank you.

Originally created by @Dario-Ciceri on GitHub (Sep 4, 2023). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1654 Hi, could you please provide a working checkbox example? I tried many examples, included yours but checkbox value is always "" Thank you.
Author
Owner

@woodenplastic commented on GitHub (Sep 26, 2023):

i set up a eventlistener in wm_stings_en.h in the script part to set the value of the checkbox to true or false depending if its checked.

"";

<!-- gh-comment-id:1735350200 --> @woodenplastic commented on GitHub (Sep 26, 2023): i set up a eventlistener in wm_stings_en.h in the script part to set the value of the checkbox to true or false depending if its checked. "<script>"; ............ "function setCheckboxEventListener(input) {" " input.addEventListener('change', function() {" " this.value = this.checked ? 'true' : 'false';" " });" "}" "document.addEventListener('DOMContentLoaded', function() {" "var input = document.getElementById(HERE YOUR INPUT ID OF THE CHECKBOX);" "input.value = input.checked ? 'true' : 'false';" "setCheckboxEventListener(input);" "});" "</script>";
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/WiFiManager#1407
No description provided.