[eluser]RobbieL[/eluser]
I've got a couple of checkboxes in a form. The values of them are dynamically generated with data from a database. What I'm looking to do is for when the form is being repopulated because of a validation error, for these checkboxes to return to the state the were submitted in.
I've managed to get this working using CI's set_checkbox with checkboxes that have static values. But having real bother with ones with dynamic values. Here's what I have so far:
Code:
<select name="day">
<option value="<?=sprintf('#u', $i);?>" <?= $this->validation->set_select('day', '<?=sprintf('u', $i);?>'); ?>><?=sprintf('u', $i);?></option>
</select>
I know the problem is lying in the second parameter of the set_select function. I've tried the usual formatting options, but just can't get it to work. Anyone got any experience on the matter and able to shed a little on the problem?
Cheers.