Welcome Guest, Not a member yet? Register   Sign In
Fatal error: Call to a member function set_message() on a non-object in...
#1

[eluser]Noisy[/eluser]
I'm using the Form Validation class with some callback functions. To be exact 4 fields with callback functions and 3 of them give me the error.

At first I use
Code:
'rules' => 'trim|required|xss_clean|valid_email|callback_email_check'
as rule, without any problems. The callback function looks like this
Code:
function email_check($mail)
    {
        $this->db->flush_cache();
        $this->db->select('email');
        $this->db->where('email', $this->db->escape($mail));
        $result = $this->db->count_all_results('users');
                
        if($result == 0 AND !empty($mail))
        {
            return true;
        }else{
                        $this->validation->set_message('email_cheack', 'Diese eMail-Adresse ist bereits bei uns registriert.');
            return false;
        }
    }

The second rule
Code:
'rules' => 'trim|required|xss_clean|callback_check_anrede'
and the corresponding function
Code:
function check_anrede($param)
    {
                $var = in_array($param, array('Herr', 'Frau'));
                
                if($var)
                {
                    return true;
                }else{
                    $this->validation->set_message('check_anrede', 'Verwenden Sie bitte nur "Herr" oder "Frau" als Anrede.');
                    return false;
                }
    }

I really don't know why I get this messages. To me both functions like exactly the same in their structure.


Messages In This Thread
Fatal error: Call to a member function set_message() on a non-object in... - by El Forum - 06-19-2010, 01:10 PM



Theme © iAndrew 2016 - Forum software by © MyBB