
Originally Posted by
thomas
This parameter defines that no further validator will be processed when set to true.
Hi,
You are correct that no further validator(s) will be processed when breakchainonfailure is set to true. Unfortunately, that doesn't help me solve the problem of getting just 1 error message from the EmailAddress validator instead of possibly multiple error messages.
What I ultimately wanted was to get the error messages and render only the very first error message. However, after taking a look at Zend/Validate/EmailAddress.php's isValid() method, I don't think this is possible. However, I did find that it is possible to subclass Zend/Validate/EmailAddress.php and overwrite getMessages() method so that only 1 error message will be displayed when EmailAddress validation fails:
Code:
<?php
class My_Validate_EmailAddress extends Zend_Validate_EmailAddress
{
public function getMessages() {
$this->_messages = array("This is not a valid e-mail address.");
return $this->_messages;
/* OR SIMPLY
return array("This is not a valid e-mail address.");
*/
}
}