Welcome Guest, Not a member yet? Register   Sign In
Unable to Access an Error Message Corresponding to Your Field Name
#3

[eluser]$ilovephp[/eluser]
This is your code:
Code:
function username_not_exists($username)
{
            
$this->form_validation->set_message('username','That %s already exists. Please choose a different username and try again');
            
    if($this->User_model->check_exists_username($username))
    {
        return false;
    }
    else
    {
        return true;
    }
}

try editing your above code with this below:

Code:
function username_not_exists($username)
{
            
$this->form_validation->set_message('username_not_exists','That %s already exists. Please choose a different username and try again');
            
if($this->User_model->check_exists_username($username))
{
    return false;
}
else
{
    return true;
}
}

Notice the $this->form_validation->set_message(), instead of 'username', we change the first parameter with the 'username_not_exists' which is the name of your call back method.


Messages In This Thread
Unable to Access an Error Message Corresponding to Your Field Name - by El Forum - 04-19-2010, 01:03 AM



Theme © iAndrew 2016 - Forum software by © MyBB