Reputation: 7563
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
Reputation: 2986
You could use $form->getMessages()
to get the error messages.
$form->isValid($this->_getAllParams());
$form_messages = $form->getMessages();
Upvotes: 10