I have the following code
$validators = array(
'name' => array('NotEmpty',
'messages' => 'A valid name is required'
),
'email'=> array(
new Zend_Validate_Regex("^[a-z0-9]+[a-z0-9_-]*(\.[a-z0-9_-]+)*@[a-z0-9_-]+(\.[a-z0-9_-]+) *\.([a-z]+){2,}$^"),
'messages' => array('A valid email is required',
Zend_Validate_Regex::NOT_MATCH=>'The email is not valid',)
))
and when i check if isValid and both name and email are empty i get for both 'A valid name is required'
the result looks like
Array
(
[name] => Array
(
[isEmpty] => A valid name is required
)
[email] => Array
(
[isEmpty] => A valid name is required
)
)
So my question is how to make to get for each the needed message in case when both are empty? I also need the email validation to work and display the proper message. Thanks in advance.