Dmitry
Dmitry

Reputation: 7563

Zend_Form getErrors

I have a form.
It's checked: $isValid = $form->isValid($this->getRequest()->getPost())

The problem is errors are empty.
$form->getErrors() returns array {"field1": [], "field2": [], "field3": [], "field4": []} when form is invalid.

So inner arrays are empty. What should I do to find why form is invalid? Code is not developed by me, but there is nothing suspicious in it.

Upvotes: 5

Views: 7232

Answers (1)

ro ko
ro ko

Reputation: 2986

You could use $form->getMessages() to get the error messages.

 $form->isValid($this->_getAllParams());
 $form_messages = $form->getMessages();

Upvotes: 10

Related Questions