Quote:
Originally Posted by kmg
PHP Code:
$form->addElement('password', 'confirmPassword',
array(
'required' => true,
'label' => 'Confirm Password',
'validators' => array(
array('StringLength', 20, 6),
array('regex', false, '/^[a-z0-9]/i'),
array('CompareToField', false, 'password')
)
)
);
|
Just to help anyone out who may be getting error messages when trying the above code snippet. Change the:
PHP Code:
array('CompareToField', false, 'password')
to
PHP Code:
array('CompareToField', false, array('password') )
It puzzled me for a bit, the 3rd parameter needs to be an array.