I’m a PHP coding hobbyist. I’ve hit a brick wall on getting checkbox data from a form.
If I set up the form to manually check the box, the checkbox array is created perfectly.
If I code to automatically check some checkboxes, the checkbox array is empty when I submit.
This is my form line: <input type=“checkbox” name=“check_list[]” value="<?php echo $customer_id ?>" <?php echo $checked; ?>> This produces an empty array.
If I remove <?php echo $checked; ?> and manually check the checkbox it works.
$checked is either “checked” or “”.
Another observation. If I uncheck and check again an automatically checked checkbox, it works.