Alex Rivera | Logout

how do I get all checkbox variables even if not checked from HTML to PHP?

Asked 2009-12-22T03:37:25.760
25

I noticed that PHP seems to return only values of checked checkboxes. I would like to see a list of checkboxes, not just values of checked checkboxes. Is there a way to detect variables of unchecked boxes?

I asked because I want to be able to update settings. For example, I have a few options that are already checked but if an user decides to uncheck an option, I need to know that unchecked value so I can update the option to be disabled.

Edit
Report

1 Answer

1

I just stumbled across this problem myself and I sorted it by updating all values in the database to unchecked then re-checking only the ones that are in the POST data, this works fine for me but might not be everyone's cup of tea.

answered 2010-06-25T10:46:00.657

Your Answer