[eluser]onejaguar[/eluser]
Prepping does make it a little trickier; the result depends on which version of CI you are using.
In CI 1.6.x prep function change the $_POST values as they are called. For instance if your rules are:
Code:
$this->validation->set_rules('other_field','trim');
$this->validation->set_rules('field2','trim|callback_double_check');
Both values will be trimmed and stored in $_POST by the time double_check is called.
There is a new form validation library in CI 1.7.0 (not officially released yet) and it doesn't change $_POST until all rules and prep function have been run, so $_POST['other_field'] would not be trimmed when double_check was called. If you wanted access to the prepped variable you would use set_value(); e.g.:
Code:
return ! (empty($var) && empty($this->form_validation->set_value('other_field')))
Despite the function name set_value actually GETS the value. 1.7.0 is subject to change...