[eluser]codelearn[/eluser]
Hey guys,
I have a form field that is filled dynamically by the database, like so:
Code:
<?php foreach($listing_q->result() as $sublist): ?>
<input type="hidden" name="main_<?=$sublist->id; ?>" value="<?=$list->id; ?>" />
<li><input type="checkbox" name="sub_<?=$sublist->id; ?>" id="<?=$sublist->id; ?>" /> <?=$sublist->name; ?></li>
<? endforeach; ?>
<!-- end for each subcategory -->
</ul>
<br /><br />
<? endforeach; ?>
Somehow, in the controller method it posts to, I need to loop through all of the sub_<?=$sublist->id; ?>. I'm not sure how to loop through all $_POST variables (if thats even possible).
Any help would be much appreciated.