openEMR 7.0.2(1), hosted on xampp in windows
Hi. I tried creating a custom form, containing checkboxes. I find that if I check a checkbox and save the form, all is fine. If I then edit the form and uncheck the checkbox and save, the checkbox remains checked, and the corresponding field in form’s table has still has the “checked” value
I found that save.php for my form is calling formUpdate, with parameter $_POST (and formUpdate lives in library\api.inc.php – took a while to find that). $_POST, as received by formUpdate, does not contain my checkbox field. Actually, in save.php for my form, $_POST also does not contain info for my unchecked checkboxes, so this is not an issue with formUpdate, but seems to be a general browser issue with form submission via POST, in that unchecked checkboxes are ignored by the submit.
Am I understanding this right?
Any kludge to get a checkbox to send some value when unchecked, so something will get written to the database for an unchecked checkbox?
I guess I could have a hidden field in my form that is valued for both checked and unchecked state of the checkbox, and pass that in form submission. Seems a rather painful approach
Thanks for any better ideas
– Hank