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

translate errormessage "please fill out this field"


Go to End


3 Posts   7289 Views

Avatar
stroknal

Community Member, 2 Posts

14 January 2014 at 12:01am

Hi, just started with Silverstripe, I created a contact form, which works as promised, but I can't find where to translate the errormessage "please fill out this form". I found the .js files, where for example "Please fill out \"%s\", it is required." is translated, but I get the other message.

Any help would be much appreciated.

Avatar
stroknal

Community Member, 2 Posts

19 January 2014 at 1:37am

It appears to be HTML5 built in validation, so not silverstripe at all. Can be overridden with jquery: http://jsfiddle.net/zpkKv/2/

Avatar
kinglozzer

Community Member, 187 Posts

20 January 2014 at 10:30pm

An alternative solution is to disable the HTML5 validation entirely, then simply fall back to SilverStripe's server side validation. You can do this by adding the 'novalidate' attribute to your form:

$form = new Form(...);
$form->setAttribute('novalidate', true);