Yeah - instead of "invalid", us "max_length", see http://www.symfony-project.org/forms/1_2/en/B-Validators#chapter_b_sub_sfvalidatorstring
On Tue, Nov 3, 2009 at 10:47, Mark Smith <[email protected]> wrote: > > OK, maybe I'm being thick, but that's not working for me: > > In the configure method I have: > > $this->setWidget("notes", new sfWidgetFormTextarea()); > $this->setValidator("notes", new sfValidatorString(array > ('min_length' => 0, 'max_length' => 40000,'required' => false),array > ('invalid'=>'Notes field is too long.'))); > > But still getting a huge error message generated: > > 'notes ["asdasdasdasdasdasdasdasdasdasdasdasdasdasdasdasd...asd" is > too long (40000 characters max).]' > > Any idea what I'm doing wrong? > > Thanks > > On Nov 2, 5:08 pm, David Ashwood <[email protected]> wrote: >> You can customize >> them:http://www.symfony-project.org/forms/1_2/en/02-Form-Validation#chapte... >> >> On Mon, 2009-11-02 at 08:58 -0800, Mark Smith wrote: >> > Is it possible to customise the error message coming from an sfForm so >> > that the contents of the validated field don't get spat back out? >> >> > I.e. at the moment the getMessage() function is returning: >> >> > ID ["abc" is not an integer.] >> >> > But I would rather have >> >> > ID is not an integer. >> >> > Thanks for any help >> >> > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~----------~----~----~----~------~----~------~--~---
