I just can't figure it out how to set custom validator messages in Zend_Form object. Here is an example code.
$this->addElement('password', 'password', array(
'label' => 'Password',
'decorators' => array('ViewHelper'),
'filters' => array('StringTrim'),
'validators' => array(
array('Digits', false, array('messages' => array('notDigits' => 'Only digits are allowed here')))
),
'required' => true
));
When I try to validate the form entering invalid data a message saying "notDigits" appear. I tried to change 'notDigits' to Zend_Validate_Digits::NOT_DIGITS, but it still doesn't work as expected.
Any help is greatly appreciated!