Zend EmailAddress Validation returning multiple errors

前端 未结 4 1150
悲&欢浪女
悲&欢浪女 2021-01-15 10:36

I am unable to make Zend_Validate_EmailAddress show only 1 error message when the user enter invalid email address. The code is

$email = new Zend_Form_Elemen         


        
4条回答
  •  礼貌的吻别
    2021-01-15 10:51

    you have to write validator like this...

    $email->addValidator(
        'EmailAddress', 
        true, 
        array( 'messages' => array( 'emailAddressInvalidFormat' => "Email Address is Not Valid... !
    ", "emailAddressInvalidHostname"=>"Email Address is Not Valid... !
    ", "hostnameUnknownTld"=>"Email Address is Not Valid... !
    ","hostnameLocalNameNotAllowed"=>"Email Address is Not Valid... !
    ") ) );

提交回复
热议问题