[eluser]David Johansson[/eluser]
I think the best way is to extend the Form validation library.
download the attached file and unzip it in the application/libraries folder, then you should be able to call the function:
Code:
$this->form_validation->error_count();
(I haven't tried this, but i guess it would be something similar at least)
or just copy paste the following to a php file called MY_Form_validation.php to the same location.
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class MY_Form_validation extends CI_Form_validation {
function MY_Form_validation()
{
parent::CI_Form_validation();
}
/**
* Error Count
*
* Returns the the number of errors
*
* @access public
* @return int
*/
function error_count()
{
return count($_error_array);
}
}
// END Form Validation Class Extention
/* End of file MY_Form_validation.php */
/* Location: ./system/application/libraries/MY_Form_validation.php */