Welcome Guest, Not a member yet? Register   Sign In
empty set_value() after a submit
#1

[eluser]Xeoncross[/eluser]
I was trying to skimp on code and left off the return FALSE statements in my callbacks as PHP functions naturally return a false value with no return type.

Code:
function email_check($email) {

    if ($this->auth->is_email_available($email)) {
        return TRUE;
    }

    $this->form_validation->set_message('email_check', 'Email is already used by another user.');
}

This will not work - you will wind up with an empty set_value() as the form_validation lib uses is_bool() to check the returned result of the callbacks.

Quote:If your callback returns anything other than a boolean TRUE/FALSE it is assumed that the data is your newly processed form data.

Maybe having this here will help someone that searches the forum.




Theme © iAndrew 2016 - Forum software by © MyBB