I'm trying to add custom messages to the validators. Here is my code which I believe is exactly how it's supposed to be:
PHP Code:
$group->addValidator('alnum', false, array('messages' => array("notAlnum"=>"Not Alphanumeric", "stringEmpty"=>"Required")));
Here is a quote from the zend framework page on validators:
Quote:
Providing Custom Validator Error Messages
Some developers may wish to provide custom error messages for a validator. Zend_Form_Element::addValidator()'s $options argument allows you to do so by providing the key 'messages' and setting it to an array of key/value pairs for setting the message templates. You will need to know the error codes of the various validation error types for the particular validator.
|
http://framework.zend.com/manual/en/....elements.html
My code is not overwriting the message and it is still returning the default message. Does anyone know how to get this to work.
|