Custom validate message is not showing

public function validation() {

    $this->validation(new EmailValidate(array(
        'field' => 'email',
        'message' => 'Please enter a valid Email address'
    )));

    when I submit the validator display "email is required" instead of "Please enter a valid Email address"


4.2k

I'm not sure if you've checked this yet but I've run into something similar before. When you're validating your form, are you testing it on a form that also actually saves/updates a record in the database?

Usually if you see the "{field} is required" error, it's a "PresenceOf" validator, either on the form or in a model. If you use the Email Address validator, it will validate when there is a value but is not a valid email. If there is a PresenceOf validator present but no value, it will throw that error frist. Just a thought that hopefully points you in the right direction.