Are you using Laravel as backend ?
Seems more related to your framework which handle request than the package (bulma-switch does not change browser/framework behavior only design).
I am running this website on a development board (ESP8266) and I am correctly getting all the parameters of the post request (considered that the form has also text inputs) apart from those
I know but my javascript code was supposed to change switches' value depending on their checked or not attribute.
Doesn't it? How should it be changed?
not sure you can dynamiccally change a checkbox value this way. because the value is sent only if checkbox is checked. if not, no value at all for this element will be sent with the form. so you can't try setting true/false as value and check if meas-hum is true/false because meas-hum will not be set in form data if not checked.
hard code the value in html and check if meas-hum exists in form data when form is submitted.
I have developed a form (POST method) which contains some switches, but they send "on" and nothing instead of "true" and "false".
switch example `
switch handling function
document.querySelectorAll(".switch").forEach(function (swt) { swt.addEventListener("click", function (e) { swt.value = swt.checked; }); });
Are you using Laravel as backend ? Seems more related to your framework which handle request than the package (bulma-switch does not change browser/framework behavior only design).
I am running this website on a development board (ESP8266) and I am correctly getting all the parameters of the post request (considered that the form has also text inputs) apart from those
The value "on" is the default one (If the value is not otherwise specified, it is the string on by default). See: https://developer.mozilla.org/fr/docs/Web/HTML/Element/Input/checkbox for more understanding on how checkboxes are working.
I know but my javascript code was supposed to change switches' value depending on their checked or not attribute. Doesn't it? How should it be changed?
not sure you can dynamiccally change a checkbox value this way. because the value is sent only if checkbox is checked. if not, no value at all for this element will be sent with the form. so you can't try setting true/false as value and check if meas-hum is true/false because meas-hum will not be set in form data if not checked. hard code the value in html and check if meas-hum exists in form data when form is submitted.
unfortunately I cannot do that, I need some kind of javascript handling