title: CodeIgniter form_radio with set_value
body: <p>I am having a bit of trouble with my form and radio buttons, with input text I do this:</p>
  
  <pre><code>&lt;?php echo form_input('lastname', set_value('lastname'), 'id=lastname'); ?&gt;
  &lt;?php echo form_error('lastname'); ?&gt;
  </code></pre>
  
  <p>and when the validation runs and that input field that is filled out gets the valued returned...what I am looking for is a way to do this with radio buttons</p>
  
  <pre><code>&lt;tr&gt;&lt;td&gt;&lt;?php echo form_label('Gender: ', 'gender'); ?&gt;&lt;/td&gt;&lt;td&gt;&lt;?php echo form_label('Male', 'male') . form_radio('gender', 'M', '', 'id=male'); ?&gt;&lt;br&gt;&lt;?php echo form_label('Female', 'female') . form_radio('gender', 'F', '', 'id=female'); ?&gt;&lt;/td&gt;&lt;td&gt;&lt;?php echo form_error('gender'); ?&gt;&lt;/td&gt;&lt;/tr&gt;
  </code></pre>
  
  <p>as you can see both my radio buttons have values already F or M.....how do I have the button that is selected returned selected?</p>