I am generating a checklist based on mysql data in an HTML form. When the submit button is clicked the php script changes the "complete" field in the mysql database. How can I process more than one item at a time with lists that have variable lengths? Currently when I click more than two boxes, only one gets processed.
Here's the HTML form:
<form method='post' action='listprocessor.php'>
<input style="float:right" type='checkbox' name='complete_goal' value='61'>Milk</input>
<input style="float:right" type='checkbox' name='complete_goal' value='117'>Eggs</input>
<input style="float:right" type='checkbox' name='complete_goal' value='118'>Bread</input>
<input style="float:right" type='submit' name='submitbtn' value='Completed'></input>
</form>
and here's the simplified php:
$_POST['submitbtn'];
$completed_goal = $_POST['complete_goal'];
$query = mysql_query("UPDATE notes SET complete='1' where note_id='$completed_goal'");