1

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

1 Answer 1

4

Try this:

$element->setRequired(true)->addErrorMessage('Your message');
Sign up to request clarification or add additional context in comments.

4 Comments

Thanks, but how to do this when using Zend Filter Input with array notation
Are you adding filter for checking nonempty?
no. Think the problem is: when nothing is selected the field is not submitted at all..
This will be stop automatically on the method isValid() of the form submit.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.