Setting a default value for a radio button with set_radio helper function |
[eluser]HobbesTheTiger[/eluser]
Hi all, I'm using the [/code]set_radio helper function to re-populate a radio button. I know from documentation that it's possible to use the same function to set an item as the default, but I can't get it to work. Below there's my code. In the controller I have: Code: $this->form_validation->set_rules('patient_sex','Sex','required'); And in the view: Code: <div> When I load the form for the first time, no item is selected. Perhaps I've missed something?
[eluser]HobbesTheTiger[/eluser]
Sorry, this is definitely NOT a bug. The function failed to re-populate the radio button because the code around the code I posted above contained, by mistake, another input element with the same name. |
Welcome Guest, Not a member yet? Register Sign In |