Jump to:

22977 Posts in 11758 Topics by 2826 members

General Questions

SilverStripe Forums » General Questions » Form Validation Message (Custom Form) only offering generic "this" field label

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 1256 Views
  • AlaVive
    Avatar
    Community Member
    42 Posts

    Form Validation Message (Custom Form) only offering generic "this" field label Link to this post

    Hi, All.

    I've seen a similar problem in the archives for what I'm currently seeing in my custom form (http://silverstripe.org/archive/show/80566#post80566), but I don't know that it's even related.

    My problem is that the SS form validation is only giving me a "Please fill out "this", it is required" warning when a text field is not filled out. I want it to say "Please fill out 'First Name'..."

    It works fine for my Dropdown fields.

    I had hoped the built-in functionality would save me time, but is my only hope to use custom JQuery validation?

    The following is just a snippet of the code.

    new FieldGroup(
       new HeaderField('Your Details'),
       new DropdownField("Title", "Title", $titlearray, "DefaultValue", null, "Select"),
       new TextField("FirstName", "First Name"),
       new TextField("LastName", "Last Name"),
       new EmailField("Email", "Email Address"),
       new TextField("Company", "Company/Organization Name"),
       new CountryDropdownField ("Country", "Country", "DefaultValue", null, "Select")
       ),


    If there are any additional (secret) parameters for TextFields that would resolve this, it would be great to know.

    Thanks!

  • dalesaurus
    Avatar
    Community Member
    283 Posts

    Re: Form Validation Message (Custom Form) only offering generic "this" field label Link to this post

    This happens when you have your FieldGroups nested in other groups or containers. It is a traversing error with the Behavior script used in 2.3. I filed a ticket, no love on it yet. They're refactoring that JS for 2.4 so it will ultimately be fixed.

    http://open.silverstripe.org/ticket/4578

    The workaround is to un-nest your field groups.

    1256 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.