mercredi 18 février 2015

Is there an alternate way to post empty checkboxes?

The standard answer to the "how do I see if a checkbox is unchecked?" when checking post variables seems to be to use to elements with the same id. A hidden input with id=X and a checkbox with id=X. See http://ift.tt/1zPeOQa.


That seems wrong, because ids are supposed to be unique. Don't believe me? Check http://ift.tt/1zPeOQc. "This name must be unique in a document." Having a hidden input and a checkbox with the same id breaks the rules.


Is there a different way to do this? And if so, what is wrong with the alternate way?





Aucun commentaire:

Enregistrer un commentaire