I have a hidden text field, whose initial value I have set to "init" for the purposes of this demonstration. The text field is bound to a field "metadata" in my database.
Now I create a visible checkbox. The code behind the checkbox is:
I then run the "Preview". I click the checkbox, then submit the form. Result in database: metadata = "init".
I have used the developer tools in the browser to verify that my code is being run. I even made the text field visible so I can see the value change as I click the checkbox. But the value saved to the database is always "init".
What am I doing wrong?