title: Repopulate radio buttons on failed validation (CodeIgniter)
body: <p>I'm having a problem with CodeIgniter repopulating a form after validation fails. </p>
  
  <p><strong>HTML:</strong></p>
  
  <pre><code>&lt;label for="public"&gt;Anyone&lt;/label&gt;
  &lt;input type="radio" name="target" value="public" &lt;?php echo set_radio('target', 'public', TRUE); ?&gt; /&gt;
  
  &lt;label for="direct"&gt;Specific&lt;/label&gt;
  &lt;input type="radio" name="target" value="direct" &lt;?php echo set_radio('target', 'direct'); ?&gt; /&gt;
  </code></pre>
  
  <p>When I first load the form I get this source code: </p>
  
  <pre><code>&lt;label for="public"&gt;Anyone&lt;/label&gt;
  &lt;input type="radio" name="target" value="public"  checked="checked" /&gt;
  
  &lt;label for="direct"&gt;Specific&lt;/label&gt;
  &lt;input type="radio" name="target" value="direct"  /&gt;
  </code></pre>
  
  <p>... so the third parameter is working (the default "TRUE")</p>
  
  <p>But when I submit the form with validation errors on other fields, the form is reloaded with no radio button selected. </p>
  
  <p>A <code>var_dump($_POST)</code> after submitting (with intentional validation errors on other fields) shows this:</p>
  
  <pre><code>array (size=9)
    'target' =&gt; string 'direct' (length=6)
     ...
  </code></pre>
  
  <p>but no radio button is selected. </p>
  
  <p>Got to be something simple... help?</p>