Zend_Form custom errors

I’ve been having trouble setting multiple custom errors to the same field. I’ve made a custom validator to do this for me as it was needed before, but for something like checking valid email it shouldn’t be necessary.

I know to change the error message of a required field I’d use ‘messages’ => array(‘IsEmpty’ => ‘errer message here’). And I could use setErrorMessage() but I’ve only had success of adding 1 error to encompass all errors thus far.

So How might I add IsEmpty error and also a seperate error for ValidEmail

Does my question need rephrasing or do I have a stumper? I figure it wold be done with an array inside of addErrorMessages(); but I’m not sure how.

I know that the Email validator is a special case because it also proxies to the Hostname validator. This really complicates the error message change process.

Well take another example in its place then. Alnum and NotEmpty for example.

I wrote some examples on a related stack overflow question.

Short answer: pass ‘messages’ => ‘string’ to each validator to override per validator.

Yes I’ve tried this. When one error is tripped it shows all errors.