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.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Field names in form validation messages


Reply


3 Posts   1925 Views

Avatar
cinek

Community Member, 17 Posts

31 May 2008 at 6:11am

I'm using the Contact page to create a simple form. Everything's nice, including localised validation messages, except that I get things like "EditableEmailField1" for field names, like:
"EditableEmailField1 is required".

Is it possible to change this? In the CMS or should I subclass the UserDefinedForm and tweak its display?

I'm using SilverStripe 2.2.1.

Avatar
cinek

Community Member, 17 Posts

31 May 2008 at 8:50am

Now, the fun starts when you use different browsers :)

The phenomenon described above can be experienced in Opera. The messages displayed are localised but they don't display correct field names.
In Firefox on the other hand the messages are not localised but the fields names are as I have entered in the CMS.
I can't wait to get my laptop near a Windows machine for IE testing :>

This sheds some light on the issue however: in Opera the javascript validation doesn't seem to work - messages show only when I press the "submit" button. On Firefox the javascript validation works.
So, the javascript part is not localised and the server side part of the validation provides incorrect field names.

Where do I start patching the code? :)

Avatar
cinek

Community Member, 17 Posts

6 June 2008 at 9:34am

Just for the record: I've opened a ticket and sent some patches for RequiredField (i.e. server-side validation).
This works in my case but I have not way to test it broadly - my knowledge of SilverStripe's guts is to shallow.

[url]http://open.silverstripe.com/ticket/2560[/url]