This is strange. I'm trying to set the error message for my email validation element in Zend form. Other fields are working correctly-but not email-what's up?
code bit:
$name = new Zend_Form_Element_Text('name');
$name ->setLabel('Name:')
->setRequired(true)
->addValidator('Alnum')
->addValidator('NotEmpty');
$name ->getValidator('NotEmpty')->setMessage('Please enter your name.');
$name ->getValidator('Alnum')->setMessage('Name can only contain letters and spaces.');
$email = new Zend_Form_Element_Text('email');
$email ->setLabel('Email:')
->setRequired(true)
->addFilter('StringToLower')
->addValidator('NotEmpty')
->addValidator('EmailAddress');
$email ->getValidator('NotEmpty')->setMessage('Please enter your email address.');
$email ->getValidator('EmailAddress')->setMessage('Email is not in proper format.');
Name works, but email doesn't work.
I am still getting the defauly error message: '' is no valid email address in the basic format local-part@hostname