I could not find this question in the forum by searching, so I thought I would post it…
I have a checkbox group that is dynamically generated from a SQL statement. Here is that code…
<p class="formServices">
<?php do { ?>
<label>
<input type="checkbox" name="services[<?php echo $row_rsServices['ID']; ?>]" value="1" id="<?php echo $row_rsServices['ID']; ?>">
<?php echo $row_rsServices['SERVICE']; ?>
</label>
<br>
<?php } while ($row_rsServices = mysql_fetch_assoc($rsServices)); ?>
</p>
I have a SQL statement that pulls the previous selections that an end user has made from the db. So what I am attempting to do is to create an edit screen where the end user can make changes. So how do I dynamically set checked=checked on items within this dynamically built checkbox groups? For some reason, I am having difficulty in figuring out the looping logic.
Thanks,
~Clay