Hi there,
I am trying to use ConfirmedPasswordField in a registration page. I have managed to get it to work, but now i want to impose some additional validation on the object eg set the min number of charachters to 8, enforce both numbers and letters be used etc.
I am trying to use it as follows, but it does not work:
class RegisterPage_Controller extends Page_Controller {
function Form() {
$member = new Member();
$fields = $member->getMemberFormFields();
$actions = new FieldSet(
new FormAction('register', 'Register')
);
$password = new ConfirmedPasswordField ('Password', 'Password'); // this works
$password->setCanBeEmpty('false'); //this works
$password->setMinLenth('8'); // gives errors
$password->setMaxLenth('16'); // gives errors
$password->characterStrength(2, array('lowercase', 'uppercase', 'digits', 'punctuation'));
$fields->insertAfter($password, "Email");
$validator = new RequiredFields('FirstName','Surname','Email','Password');
$form = new Form($this, 'Form', $fields, $actions, $validator);
return $form;
}
Please help, Thanx