Jump to:

1976 Posts in 1306 Topics by 607 members

Form Questions

SilverStripe Forums » Form Questions » Password validation in CMS

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

Page: 1
Go to End
Author Topic: 1778 Views
  • Reflektera
    Avatar
    49 Posts

    Password validation in CMS Link to this post

    Don't know if this is the right forum for this but... yeah... anyway...

    For various reasons I have to do a custom made user system kind-of -thing. I have a dataobject which represent the member that looks like this:

    <?php
    class Medlem extends DataObject {   
       static $db = array(
          'Fornamn' => 'Varchar',
          'Efternamn' => 'Varchar',
    ...
       'Losenord' => 'Varchar(64)'
       );
       static $has_one = array(
          //'Avatar' => 'Image'
          'MinOrganisation' => 'Organisation'
       );

       function getCMSFields_forPopup() {
       
          $fields = new FieldSet(
             new TabSet("Root",
                new Tab(
                $title = 'Main',
                   new TextField("Fornamn", "Förnamn"),
                   ...
                   new CalendarDateField("Medlemsdatum", "Datum för medlemskap")
                ),
                new Tab('Medlemsuppgifter',
                   new HeaderField("Medlemsuppgifter"),
                   ...
                   new ConfirmedPasswordField('Losenord','Lösenord',null,null,false,'Bekräfta lösenordet')
                )
             )

          );
        return $fields;
       }
    }
    ?>

    The problem is that the ConfirmedPasswordField doesn't validate. Seems like there is some javascript missing but I can't figure out how to get it there. Anyone who knows?

  • Reflektera
    Avatar
    49 Posts

    Re: Password validation in CMS Link to this post

    Anyone?

  • dio5
    Avatar
    Community Member
    501 Posts

    Re: Password validation in CMS Link to this post

    I'd say have a look at the popup that occurs with MemberTableField. Afaicr there's a confirmedpasswordfield as well, see how that works.

    In most cases, js-validation of formfields did not work in the CMS (2.3 will be different I think), only on frontend. Not sure how it's with the passwordfield though - but I do know the popup of membertablefield has it - so I figure your solution must be there.

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