Okay, I have a really weird script here, but it says in the comments that it does what it does for a very good reason so I'd best not touch it.
For my web framework, I have variables sorted into files; one file contains just default settings for all variables used for page creation, and the other is advanced information for some of those variables which will be automatically added to the site administration page.
It's all pretty cool, technically (ignoring my ignorance of the wonders of databases) :)
Unfortunately, I have encountered a problem.
For the sake of user friendliness, boolean values are done with check boxes in the admin page. It turns out that an HTML form return, however, does not bother to return a check box when it is not checked.
Since the admin page's saving method loops through returned form values instead of variables (weird reasons to do with cleanliness and "cleverness"), this means that an unchecked checkbox is not observed as setting a variable to 0!
I've thought of a few solutions involving hidden fields, but they all involve a complete reliance on Javascript which I am trying to avoid.
I'm a bit lost :(
For my web framework, I have variables sorted into files; one file contains just default settings for all variables used for page creation, and the other is advanced information for some of those variables which will be automatically added to the site administration page.
It's all pretty cool, technically (ignoring my ignorance of the wonders of databases) :)
Unfortunately, I have encountered a problem.
For the sake of user friendliness, boolean values are done with check boxes in the admin page. It turns out that an HTML form return, however, does not bother to return a check box when it is not checked.
Since the admin page's saving method loops through returned form values instead of variables (weird reasons to do with cleanliness and "cleverness"), this means that an unchecked checkbox is not observed as setting a variable to 0!
I've thought of a few solutions involving hidden fields, but they all involve a complete reliance on Javascript which I am trying to avoid.
I'm a bit lost :(