Welcome Guest, Not a member yet? Register   Sign In
Repopulating Checkboxes/Lists With Dynamic Content
#1

[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="&lt;?=sprintf('#u', $i);?&gt;" &lt;?= $this->validation->set_select('day', '&lt;?=sprintf('&#x02;u', $i);?&gt;'); ?&gt;>&lt;?=sprintf('&#x02;u', $i);?&gt;</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.




Theme © iAndrew 2016 - Forum software by © MyBB