CodeIgniter Forums
Radio button - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Radio button (/showthread.php?tid=38956)



Radio button - El Forum - 02-24-2011

[eluser]Crnaovca[/eluser]
I have created form, connected to DB, it works ok, it saves data BUT, if there is error in validation and error msg appeares, all radio buttons status are deleted. How to save them?

This is annoying, user click, gets error msg and after that radio buttons must be clicked again.


Radio button - El Forum - 02-24-2011

[eluser]Crnaovca[/eluser]
I got it ...
That is when looking at manual too literal ...

Problem was in this line

<input id="vrsta" name="vrsta" type="radio" class="" value="Meso" <?php echo $this->form_validation->set_radio('vrsta', 'option1'); ?> />

and it should be

<input id="vrsta" name="vrsta" type="radio" class="" value="Meso" <?php echo $this->form_validation->set_radio('vrsta', 'Meso'); ?> />


Radio button - El Forum - 02-24-2011

[eluser]rogerwaldrup[/eluser]
Looks like you got it.