Welcome Guest, Not a member yet? Register   Sign In
Problem with validation
#2

Just delete
Code:
valid_email|
from validation rules or use your own callbacks:
Code:
'email' => ['label' => 'Email Address', 'rules' => 'callback_email_check|max_length [150]']
Your controller:
Code:
    public function email_check($str)
        {
                if ($str == 'test')
                {
                        $this->form_validation->set_message('email_check', 'The {field} field can not be the word "test"');
                        return FALSE;
                }
                else
                {
                        return TRUE;
                }
        }
More about callbacks:
https://codeigniter.com/userguide3/libra...on-methods
Reply


Messages In This Thread
Problem with validation - by PeVal - 09-23-2021, 06:48 AM
RE: Problem with validation - by janeiro - 09-23-2021, 01:28 PM
RE: Problem with validation - by includebeer - 09-23-2021, 02:45 PM
RE: Problem with validation - by PeVal - 09-23-2021, 11:48 PM



Theme © iAndrew 2016 - Forum software by © MyBB