I need send with post false
value of checkbox witch is not checked by default. My checkbox is defined like this:
<label><input type="checkbox" id="rez" name="rezerwowanie" value="false" />Rezerwowanie</label>
And after submit I use that code to check if checkbox is checked or not:
$Reservation = $_POST['rezerwowanie'];
if ($Reservation == false) {
$Reservation = 0;
} else
{
$Reservation = 1;
}
It work when I check the checkbox but with not checked it don't work. What's the problem here?
Aucun commentaire:
Enregistrer un commentaire