Hello!
I have a signup form that is working fine. Here it is a text element for providing the email address:
$email = new Zend_Form_Element_Text('email');
$email->setLabel($sessionSettings->tr->translate('email'))
->setValue('')
->setAttribs(array('id' => 'email', 'class' => 'required email'))
->setRequired(true)
->addFilters(array('StripTags','StringTrim','StringToLower'))
->addValidators(array(
'NotEmpty',
'EmailAddress',
array('Db_NoRecordExists', true, array('user', 'email_address'))
));
$email->getValidator('NotEmpty')->setMessage('Email address field cannot be empty.');
$email->getValidator('EmailAddress')->setMessage('Email address name not corresponding.');
$email->getValidator('Db_NoRecordExists')->setMessage('Email address is taken.');
I wonder if it is possible to add the error messages to 'addValidators' array and removing in this way the last 3 lines. Please advise.