title: CodeIgniter form validation not working properly
body: <p>I have a form set up in a controller that both loads the form and its previously populated contents from a database and processes the form as needed. The problem is $this->form_validation->run() never evaluates to FALSE, even if rules are not met.</p>
  
  <p>Controller:</p>
  
  <pre><code>public function edit_version($node, $lang)
  {
      // load form validation class
      $this-&gt;load-&gt;library('form_validation');
  
      // set validation rules
      $this-&gt;form_validation-&gt;set_rules("title|Title|required");
  
      // run validation
      if ($this-&gt;form_validation-&gt;run() !== FALSE)
      {
          // save input to database
          die("validation successful");
      }
      else
      {
          // either validation was not passed or no data to validate
          // load page edition view and display databse contents
  
          // load page model
          $this-&gt;load-&gt;model("page_model");
  
          // get the page from database
          $data["page"] = $this-&gt;page_model-&gt;get_page($node, $lang);
  
          // load views
          $this-&gt;load-&gt;view("admin/header.php", array("title" =&gt; "Edit page no.: $node, $lang version - Admin"));
          $this-&gt;load-&gt;view("admin/pages/edit_page.php", $data);
          $this-&gt;load-&gt;view("admin/footer.php");
      }
  }
  </code></pre>
  
  <p>Model:</p>
  
  <pre><code>class Page_model extends CI_Model
  {
  public function get_page($node, $lang)
  {
      // load the page
      return $this-&gt;db-&gt;get_where("pages", array("node" =&gt; $node, "lang" =&gt; $lang))-&gt;row();
  }
  
  public function save_version($page)
  {
      $this-&gt;db-&gt;where("node", $page["node"]);
      $this-&gt;db-&gt;where("lang", $page["lang"]);
      $this-&gt;db-&gt;update("pages", $page);
  }
  
  public function search($query)
  {
      return $this-&gt;db-&gt;get_where("pages", $query)-&gt;result();
  }
  }
  </code></pre>
  
  <p>View:</p>
  
  <pre><code>&lt;h2&gt;Edit page&lt;/h2&gt;
  &lt;?php
  // load form helper
      $this-&gt;load-&gt;helper("form");
  
  // open a form
  echo form_open("admin/page/{$page-&gt;node}/edit/{$page-&gt;lang}");
  
  // print validation errors
  echo validation_errors();
  
  // title and content fields
  echo form_label("Title: ", "title");
  echo form_input("title", set_value("title", $page-&gt;title));
  
  // aesthetic line break
  echo "&lt;br&gt;";
  
  echo form_label("Content: ", "content") . "&lt;br&gt;";
  echo form_textarea("content", set_value("content", $page-&gt;content));
  
  // save button and close form
  echo form_submit("submit", "Save page");
  echo form_close();
  </code></pre>
  
  <p>Thanks in advance.</p>