Welcome Guest, Not a member yet? Register   Sign In
validation, radio button, and loops?
#1

[eluser]alanphil[/eluser]
In my view I'm creating a list of concerts, like this:

Code:
<?php foreach ($concerts as $row): ?>

&lt;input type="radio" name="concert_selection" value="&lt;?=$row-&gt;id?&gt;">&nbsp;&lt;?=$row->concert_name?&gt;, &lt;?=$row->concert_date?&gt;, &lt;?=$row->count?&gt; pair(s) of tickets available<br />

&lt;?php endforeach; ?&gt;


I'm trying to add validation to keep the selected radio button selected, if some other field fails validation. I've tried many variations of the following from the user guide:

Code:
&lt;input type="radio" name="myradio" value="1" &lt;?php echo $this-&gt;validation->set_radio('myradio', '1'); ?&gt; />

When I try the following, the radio button isn't set after validation:

Code:
&lt;?php echo $this->validation->set_radio('concert_selection', "&lt;?=$row->id?&gt;"); ?&gt;

I've tried many variations of the above. What am I missing?

Alan


Messages In This Thread
validation, radio button, and loops? - by El Forum - 08-29-2008, 09:51 AM
validation, radio button, and loops? - by El Forum - 08-29-2008, 09:58 AM
validation, radio button, and loops? - by El Forum - 08-29-2008, 02:35 PM
validation, radio button, and loops? - by El Forum - 08-29-2008, 02:42 PM
validation, radio button, and loops? - by El Forum - 08-29-2008, 02:52 PM
validation, radio button, and loops? - by El Forum - 08-29-2008, 03:33 PM



Theme © iAndrew 2016 - Forum software by © MyBB