setting radio button value |
[eluser]dadamssg87[/eluser]
I'm having trouble with codeigniter's set_radio() function. I can't seem to get it to work. I have set up a simple form to try to make it work with no avail. Here is my code to display the radio buttons. Code: <?php I should mention i have another text input above the radio buttons and have the validation rules set to throw a validation error when that field is empty so the form reloads with the submitted values still in the form(except for the radio button values). It loads up fine with the first button checked and the others not. But then when i submit the form it comes back with the empty field error and none of the radio buttons checked no matter which radio button i check. Can anybody see what i'm doing wrong? I even tried copy pasting their example in the user guide but i didn't work either.
[eluser]oppenheimer[/eluser]
I don't think you can use set_radio that way. Try this post: http://ellislab.com/forums/viewthread/184991/
[eluser]theprodigy[/eluser]
Quote: Try Code: <input type="radio" name="calendar" value="n" <?php echo set_radio('calendar','n',TRUE); ?> /> None<br />
[eluser]pmoroom[/eluser]
Are you having issues having it maintain the selected value after a form is submitted but fails validation? |
Welcome Guest, Not a member yet? Register Sign In |