IHeartPHP Posted June 28, 2014 Share Posted June 28, 2014 Hi, I am exploring on the usage of checkboxes. I am able to insert the values of a checked checkboxes but how do we insert into the DB, the values of unchecked checkboxes. Thank you, Link to comment Share on other sites More sharing options...
HartleySan Posted June 28, 2014 Share Posted June 28, 2014 Hello, and welcome to the forums. I like your user name. I can't think of any use cases where you would want to insert unchecked checkboxes into the DB, so if you don't mind me asking, why do you want to do that? Thanks. Link to comment Share on other sites More sharing options...
Larry Posted June 30, 2014 Share Posted June 30, 2014 If it was a option, like receive emails?, that always gets represented in the database--0 for no, 1 for yes, that would make sense. You can just add PHP logic that sets a default value of, say, 0 unless the box is checked, in which case you use 1. Link to comment Share on other sites More sharing options...
Recommended Posts