Replying to self.

I'm trying to define my forms within config.ini files and have made it part way. The part that I can't figure out is how to set the error message template or even the error message within those files.

I put this in myForm.ini

myForm.elements.verb.type = "text"
myForm.elements.verb.options.validators.alpha.validator = "alpha"

Solution follows (should be all on one line):

myForm.elements.verb.options.validators.alpha.options.messages.notAlpha
= "Letters only"

To find the key name for a validation condition look in the api for
Validators, locate the validator type, then at its constants.  The
value of the constant is the key required.

In this example the validator is Zend_Validate_Alpha and the constant is NOT_ALPHA; its value is "notAlpha".

Hope that helps someone else.

:m)

Reply via email to