[eluser]theprodigy[/eluser]
Another thing I noticed:
Your code in the tutorial is passing the $_POST array, and using it to insert into the db. Nothing you do while using form_validation is being done other than required.
Code:
public function index()
{
if ($this->input->post('submit'))
{
if ($this->create_item($_POST)) // <-- passing $_POST array
{
Template::set_message('New ToDo item successfully created', 'success');
}
else
{
Template::set_message('Error creating new ToDo item.', 'error');
}
}
private function create_item($vars) // $_POST array
{
$this->form_validation->set_rules('description', 'Description', 'required|trim|strip_tags|max_length[255]|xss_clean'); // xss_clean and strip_tags all you want, you're inserting from $_POST, not $this->input->post.