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.

Form Questions /

translate errormessage "please fill out this field"


Reply


3 Posts   1059 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, 171 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);