homelessDevOps
homelessDevOps

Reputation: 20726

Zend_Validate_inArray - ErrorMessage: non empty value

We're using Zend_Filter_Input to validate a Dojo From at Backend. There is "option" Input Element where we have to verify that the submitted value is allowed.

Problem: If nothing is selected the Zend_Validate_inArray Validator returns

" you must provide an non Empty value"

thats fine, but we have to change the message. I cant find the proper way to do this..

        'FIELD' => array(new Zend_Validate_InArray($allowedValues),
            'messages' => 'MESSAGE_WRONG_VALUE',
            'default'  => ''
         ),

Does someone know how to change the "isEmpty" Message?

It is Zend Framework 1.11.12

Upvotes: 1

Views: 559

Answers (1)

Muhammad Zeeshan
Muhammad Zeeshan

Reputation: 8856

Try this:

$element->setRequired(true)->addErrorMessage('Your message');

Upvotes: 4

Related Questions