Welcome Guest, Not a member yet? Register   Sign In
Callbacks for own Validation Functions not working (bug?)
#1

[eluser]Unknown[/eluser]
I used the code from the documentation, but it wont work.

Code:
function register(){
...
$this->load->library('form_validation');
$this->form_validation->set_rules('username', 'Username', 'required|callback_username_check');
...
}


function username_check($str)
{
echo "debug: username_check called";

$this->form_validation->set_message('username_check', 'The %s field can not be the word "test"');
return FALSE;
}

I got an validation-error if the username field is empty (because of the "required" validation) so validation is working, but not with my custom validation, if i enter something the custom callback for validating is never called (i dont see the message, and i don't see the debug echo).

My environment is wampserver for windows with php: 5.2.5
and codeigniter is ver. 2.0.3

Am i doing something wrong or is this realy a bug?

Thanks for your help


Messages In This Thread
Callbacks for own Validation Functions not working (bug?) - by El Forum - 09-23-2011, 01:43 PM



Theme © iAndrew 2016 - Forum software by © MyBB