form_radio() validation problem - 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: form_radio() validation problem (/showthread.php?tid=45737) |
form_radio() validation problem - El Forum - 10-04-2011 [eluser]Unknown[/eluser] I want to achieve 2 things with the radio buttons: 1) I want to know how to do validation for radio buttons. 2) Upon validation error, how to auto-select the last selected radio button. Below is the code I have. I know I haven't done it correctly. If someone could guide me to the right direction, that'll be great. Thanks In my view: Code: $form_data['radio1'] = array( In my controller: Code: $this->form_validation->set_rules('radio_select', 'Radio button', 'required'); |