How to add an error message to Zend Form element after the form was already validated?
I’m trying to add error mesages I get from Zend_Auth (now I’m displaying them using flashMessenger).
I tried something like this:
$form->getElement('username')->addErrorMessage('my message');
From the zend form documentation –
If your form is not marked as invalid, it probably doesn’t show any error messages. Using
addError($message)rather thanaddErrorMessage($message)will ensure that the element is also marked invalid.