title: If condition not working with CodeIgniter validation
body: <p>I'm using CodeIgniter! I have 3 radio buttons - to choose role. If you choose one of the three radio buttons, you see different dropdowns. I want to make validation rules - to echo validation errors only on these dropdowns for the radio button you have chosen. I tried with this but it doesn't show me any validation errors. 
  First, my radio buttons are:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code> &lt;input type="radio"   name="role_id[]" onClick='showHide(this, true)' id="radio1"  value="1" /&gt;
   
  
     $data=array(
      'name' =&gt; 'role_id[]',
      'value' =&gt; '2', 
      'id' =&gt; 'radio2',
      'onclick' =&gt; 'showHide(this, true)'
      );
    echo form_radio($data);
  
    $data=array(
      'name' =&gt; 'role_id[]',
      'value' =&gt; '5',
      'id' =&gt; 'radio5',
   'onclick' =&gt; 'teachers_show(this, true)'
      );
    echo form_radio($data);</code></pre>
  </div>
  </div>
  </p>
  
  <p>My controller is:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code> public function register()
      {
        ​
   if ($this-&gt;input-&gt;post('role_id[]') === 1){
          $this-&gt;form_validation-&gt;set_rules('first_name', First name', 'trim|required');
          $this-&gt;form_validation-&gt;set_rules('last_name', 'Last name', 'trim|required'); 
          $this-&gt;form_validation-&gt;set_rules('username', 'username', 'trim|required|min_length[6]|max_length[12]|is_unique[users.username]');
          $this-&gt;form_validation-&gt;set_rules('password', 'Password', 'trim|required|min_length[6]'); 
          $this-&gt;form_validation-&gt;set_rules('password2', 'Confirm password', 'trim|required|matches[password]');  
          $this-&gt;form_validation-&gt;set_rules('email', 'Email', 'trim|required|valid_email|is_unique[users.email]');
          $this-&gt;form_validation-&gt;set_rules('location', 'Location', 'trim|required');
          $this-&gt;form_validation-&gt;set_rules('school[]', 'School', 'required');
          $this-&gt;form_validation-&gt;set_rules('class[]', 'Class', 'required');
          $this-&gt;form_validation-&gt;set_rules('role_id[]', 'Role', 'required');
          $this-&gt;form_validation-&gt;set_rules('class_divisions[]', 'Class division', 'required');
          $this-&gt;form_validation-&gt;set_rules('region', 'Region', 'required');
          $this-&gt;form_validation-&gt;set_rules('teacher[]', 'teacher', 'required');
          
          }
       ​
   elseif ($this-&gt;input-&gt;post('role_id[]') === 2){
          $this-&gt;form_validation-&gt;set_rules('first_name', First name', 'trim|required');
          $this-&gt;form_validation-&gt;set_rules('last_name', 'Last name', 'trim|required'); 
          $this-&gt;form_validation-&gt;set_rules('username', 'username', 'trim|required|min_length[6]|max_length[12]|is_unique[users.username]');
          $this-&gt;form_validation-&gt;set_rules('password', 'Password', 'trim|required|min_length[6]'); 
          $this-&gt;form_validation-&gt;set_rules('password2', 'Confirm password', 'trim|required|matches[password]');  
          $this-&gt;form_validation-&gt;set_rules('email', 'Email', 'trim|required|valid_email|is_unique[users.email]');
          $this-&gt;form_validation-&gt;set_rules('location', 'Location', 'trim|required');
          $this-&gt;form_validation-&gt;set_rules('school[]', 'School', 'required');
          $this-&gt;form_validation-&gt;set_rules('class[]', 'Class', 'required');
          $this-&gt;form_validation-&gt;set_rules('role_id[]', 'Role', 'required');
          $this-&gt;form_validation-&gt;set_rules('class_divisions[]', 'Class division', 'required');
          $this-&gt;form_validation-&gt;set_rules('region', 'Region', 'required');
        
          
          }
           elseif ($this-&gt;input-&gt;post('role_id[]') === 5 ){
              $this-&gt;form_validation-&gt;set_rules('all_teachers_show', 'ALL Teachers', 'required');
  
          }
          if ($this-&gt;form_validation-&gt;run()==FALSE)
          {
              $this-&gt;signup();
          }
          else 
          {  ​
  //register
  }
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>If I use something like this:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>  if ($this-&gt;input-&gt;post('role_id[]') &lt; 2){​
             // validation rules
       }
      
     if ($this-&gt;input-&gt;post('role_id[]') &gt;4 ){​
             // validation rules
       }</code></pre>
  </div>
  </div>
  </p>
  
  <p>It shows me validation errors but for role_id=1. For role_id=5 shows me validation errors that are for role_id=1.
  Could you help me? :) Thanks!</p>