inside your form's configure method, you need to set the error message
for each error on each validator

e.g.

$this->getValidator('name')->setMessage('max_length', 'Your text was
too long, please keep it short');

On Jan 18, 5:47 pm, Basil Hussain <basil.huss...@experience-
engine.co.uk> wrote:
> I have a couple of forms with many sfValidatorString validators on
> them. The default 'max_length' error message ('"%value%" is too long
> (%max_length% characters max).') is really not suitable to the way my
> forms are laid out in the HTML, because repeating the too-long value
> within the message throws everything out of alignment.
>
> So, I want to set a shorter message (e.g. 'Too long, %max_length%
> characters max'), but I don't want to have to add the same message
> array repeatedly for every single sfValidatorString instance on these
> forms - each has 20 of them!
>
> Is there a way to set a default 'max_length' message once for every
> sfValidatorString on a form?

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to