I have a form with an input field. If they click on a specific daypart
I want the input field to be checked
. I try to do that with the following code, but the field doesn't get the attribute checked
when I check it.
<input type="checkbox" name="dayparts[]" value="<?php echo $daypart['id']?>" <?php if (!empty($_GET['dayparts'] == '1')){ echo 'checked';}?> >
This is the url when I check something.
index.php?page=activities&dayparts%5B%5D=1