For ease of use, I like to create form fields this way:
<?php
$username = $_POST['username'];
$message = $_POST['message'];
?>
<input type="text" name="username" value="<?php echo $username; ?>" />
<textarea name="message"><?php echo $message; ?></textarea>
Thus, if the user fails in the validation, the previously entered form input will still be there, and there is no need to start from scratch.
My problem is that I cannot save the checkboxes selected with the option the user selected earlier (when the page refreshes after the check is completed). How to do it?
Derek source
share