更新时间:2023-02-22 09:17:20
There are two checks in place. The first one (that one that you see) ist the check on client side. The input field has a required parameter. So the browser knows that the field can't be blank and says than in it's language. Nothing is sent to the server till now. After filling in and sending the form, then the second check is in place which is the cakephp validation.
Try it with this:
'title' => array(
'kosher' => array(
'rule' => 'email',
'message' => 'Please make sure your email is entered correctly.'
),
'required' => array(
'rule' => 'notEmpty',
'message' => 'Please enter your email.'
)
Then you will see: 1) if you enter nothing, then the browser message appears (client side), 2) if you enter some text, which is no email, then the message from above appears ('Please enter your email.')