I am creating an email form element similar to this (inside a Zend form):
//create e-mail element $email = $this->createElement('text', 'username') ->setLabel('E-mail:') ->setRequired(true) ->addFilters(array('StringTrim', 'StringToLower')) ->addValidator('EmailAddress', false, array( 'messages' => array( Zend_Validate_EmailAddress::INVALID => 'Dit e-mail adres is ongeldig.', ) )); //add element $this->addElement($email);
Now that you have entered the wrong e-mail, a lot of messages appear:
'#' is no valid hostname for email address '@# $@ #' '#' does not match the expected structure for a DNS hostname '#' does not appear to be a valid local network name '@#$' can not be matched against dot-atom format '@#$' can not be matched against quoted-string format '@#$' is no valid local part for email address '@# $@ #'
I wonder if itβs possible for him to only display the error message provided by me, for example, βPlease enter a valid email address.β
source share