title: Codeigniter - checkbox form validation
body: <p>I have a form validation rule in place for a form that has a number of checkboxes:</p>
  
  <pre><code>$this-&gt;form_validation-&gt;set_rules('groupcheck[]', 'groupcheck', 'required');
  </code></pre>
  
  <p>If none of my checkboxes are checked upon submission, my code never gets past the validation->run as the variable does not exist:</p>
  
  <pre><code>if ($this-&gt;form_validation-&gt;run()):
  </code></pre>
  
  <p>If i surround my validation rule with a check for the var, the validation never passes as there are no other form validation rules:</p>
  
  <pre><code>if(isset($_POST['groupcheck'])):
     $this-&gt;form_validation-&gt;set_rules('groupcheck[]', 'groupcheck', 'required');
  endif;
  </code></pre>
  
  <p>How can I manage a checkbox validation rule where the var may not exist, and it will be the only form variable?</p>
  
  <p>Regards, Ben.</p>