Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Form Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Custom validator error message


Go to End


2 Posts   2716 Views

Avatar
katja

Community Member, 46 Posts

18 March 2010 at 1:40am

Hello,

I was wondering if there is an easy way to override the error message returned by the validator. I looked at Sapphire/Validator.php, but I can't figure it out myself..

Cheers
Katja

Avatar
FungshuiElephant

Community Member, 57 Posts

22 February 2011 at 3:16am

And old post, but I thought I'd reply any way so it's there for searchers..

FormFields have a setCustomValidationMessage function which should propably work:
$myField->setCustomValidationMessage($msg);