Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Field names in form validation messages

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

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

Page: 1
Go to End
Author Topic: 1853 Views
  • cinek
    Avatar
    Community Member
    17 Posts

    Field names in form validation messages Link to this post

    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.

  • cinek
    Avatar
    Community Member
    17 Posts

    Re: Field names in form validation messages Link to this post

    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?

  • cinek
    Avatar
    Community Member
    17 Posts

    Re: Field names in form validation messages Link to this post

    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.

    http://open.silverstripe.com/ticket/2560

    1853 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.