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 /

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

Password validation in CMS

Go to End

3 Posts   2429 Views


49 Posts

16 January 2009 at 10:25am

Edited: 16/01/2009 10:25am

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:

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?


49 Posts

27 January 2009 at 8:56am



Community Member, 501 Posts

27 January 2009 at 9:04am

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.