dimanche 28 juin 2015

Make checkbox return false when unchecked

I have a form looking like:

<form>
    <input type"checkbox" name="checked[(unique_id)]">
    <input type"checkbox" name="checked[(unique_id)]">
    <input type"checkbox" name="checked[(unique_id)]">
    <input type"checkbox" name="checked[(unique_id)]">
</form>

The number of checkboxes will variate from time to time so when processing this data with PHP I have to loop the _POST['checked'] array.

My problem is that I want to take actions both when a checkbox is checked and when it's not. But only the the checked checkboxes will be added to the _POST['checked'] array.




Aucun commentaire:

Enregistrer un commentaire