I have a website, and on it I have a form with check-boxes to be filled. In PHP, I am wondering if there is a checked attribute which works when focus is lost on the check-box, not when the submit button us clicked. I have tried
if (isset($_POST['check1'])) {
// Checkbox is selected
} else {
// Alternate code
}
but it only works when the submit button is clicked. Is there any other way to do this?