Hi Sitepointers, I have a small problem finding a solution for my following problem: I need to check many checkboxes (created form a loop) to see if they have been checked. I create the checkbox form fields out of a sql table using a while loop like this: while ($r = mysql_fetch_array($result)) { extract ($r); echo "<input type=\"checkbox\" name=\"offer$id\" value=\"$headline, \"$check> "; } } Code (markup): The HTML of the output would look something like this: <input type="checkbox" name="offer1" value="Adventure Offer A, "> <input type="checkbox" name="offer2" value="Adventure Offer B, "> <input type="checkbox" name="offer3" value="Adventure Offer C, "> <input type="checkbox" name="offer4" value="Adventure Offer D, "> . . . and so on Code (markup): This is great an lets me dynamically create as many checkboxes as needed depending on the offers in the database. However how can I check which ones of them have been checked? If there'd be just one with a fixed name I'd do something like this in the while loop: if ($offer1 == "$headline, ") {$check = "checked";} else {$check = "";} Code (markup): However now I get more than 1 offer, I get $offer1 $offer2... and so on. How can check on each one??? I tried and all my ideas failed, any help out here? Thanks a lot. Tino
LOL you got me yes, sorry about that totally forgot to change :| Yes has been answered there but I'm still stuck, I don't seem to be able to code it. I'd need a small sample. Never coded that way before Anyone wants to help providing a short sample for me?? here's the answer I got from sitepoint: Thanks