Hi
I have a created a zend form, works fine along with validations.
Is there anyway I can add a custom validation within this form for the email address, for example I want to set a validation to check if the email address supplied by the user is hotmail, as I want to accept only hotmail email addresses.
<?php
class Application_Form_RegistrationForm extends Zend_Form{
public function init(){
$firstname = $this->createElement('text', 'firstname');
$firstname->setLabel('Firstname: ')
->setRequired(true);
$lastname = $this->createElement('text', 'lastname');
$lastname->setLabel('Lastname: ')
->setRequired(true);
$email = $this->createElement('text', 'email_address');
$email->setLabel('Email Address: ')
->setRequired(true);
$register = $this->createElement('submit', 'register');
$register->setLabel('Create new Account')
->setIgnore(true);
$this->addElements(array(
$firstname, $lastname, $email, $register
));
}
}
?>
Any help will be appreciated.