I have a checkbox on my form. When the submit button is clicked if there are fields on the form that weren't filled in correctly the text boxes on the form retains all of the information that was entered in. However, if I check the box, hit submit the form does not remember that it was checked. Here's my code:
if(!isset($_POST['Update_Email'])){
$_POST['Update_Email'] = "N";
}
$html .= "<td><input type=\"checkbox\" name=\"Update_Email\" value=\"" . $_POST['Update_Email'] . "\" /> Email me";
In the db the value of the ckeckbox should be Y or N. I have put an echo statement when the !isset gets run and it only gets run when the page is initially opened so I know that the it is not being reset by that code.
I'm having the same problem with <select>
If anybody can answer this my day will be made 😃