Jump to:

2011 Posts in 1436 Topics by 620 members

Form Questions

SilverStripe Forums » Form Questions » UniqueTextField allowing duplicates

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

Page: 1
Go to End
Author Topic: 1043 Views
  • PapaBear
    Community Member
    26 Posts

    UniqueTextField allowing duplicates Link to this post

    Hi All,

    I am using UniqueTextField in a custom form to make sure that email (for login) and username(for in site ID) are unique. However, Both the customer and my own testing have identified that duplicates are getting through.

    My constructor for the appropriate fields is:

       function __construct( $controller, $name ){
          $locale = i18n::get_locale();
          $fields = new FieldSet (
             new UniqueTextField("Email", 'Email', 'Member', 'That email is already in use.' ),
             new UniqueTextField("Username", 'Username', 'SiteUser', 'That username is already in use.' ),

    Whenever I try to create a new user through the form it is as if no checking is being done at all. Firebug is not reporting any errors. All the appropriate js seems to be there (UniqueFields.js, etc)

    SiteUser class extends Member if that is relevant.
    Using SSv2.3.7

    I'm using a custom form because of the complex layout requirements of the site design. Because there are many other required fields I can't just use the validator from the member class to ensure uniqueness for the email.

    Can anyone please help? This is urgent as phase one of the site is already live and taking the site down while this is resolved is not an option.


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.