I can see plenty of requests for help in here with the checkbox. I thought “that will never happen to me”.
How wrong I was. Here I am with my checkbox issue…
My check box returns nothing when checked. An empty string is sent to the database. Why?
Extra credit for answer to this:
My expectation is Wappler should send a ‘1’ or a ‘0’. What does it actually send (if it is working)?
Thank you for helping yet another newbie with a simple checkbox issue.
That is not related to Wappler. That is how checkboxes work, according to HTML specs. The checkbox will send its value on form submit only if it is checked. And it it will send a value if a value="" is set.
You can learn how checkboxes function in more details here:
Especially this part:
Note: If a checkbox is unchecked when its form is submitted, there is no value submitted to the server to represent its unchecked state (e.g. value=unchecked ); the value is not submitted to the server at all.
This is a foreign concept to me for sure!
Checkboxes I’m used to working with (not in Wappler) have a ‘selected’ property of type boolean which will be always be either true or false. This is why I got confused. I’m learning that javascript/html is not a strongly-typed language but was hoping that Wappler components would add these types of properties to the Bootstrap components. A different world…