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.

Form Questions

Password validation in CMS


Reply

3 Posts   1868 Views

Avatar
Reflektera

16 January 2009 at 10:25am (Last edited: 16 January 2009 10:25am), 49 Posts

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?

Avatar
Reflektera

27 January 2009 at 8:56am 49 Posts

Anyone?

Avatar
dio5

27 January 2009 at 9:04am Community Member, 501 Posts

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.