I have the following HTML field description:
<input type="checkbox" id="truck"> Check Truck <br>
It is a single checkbox and I would like to know if the user checked it or not. I have tried using the following PHP code but it doesn't seem to work as I always get the box being not checked when it is ie Truck is not checked.
if (isset($_POST["truck"])) {
echo "Truck is checked";
}
else
{
echo "Truck is not checked";
}
Should I put a pair of [] after the id even though it is a single check box?
Thanks for you help in advance...Charlie