Joel
Joel

Reputation: 2721

why aren't error messages showing on zend_form if validation fails?

I'm trying to get the standard error messages to show up in zend_form but they don't.

I have this:

if ($form->isValid($formData)) {
                // do stuff
            } else {
                $form->populate($formData);
                $this->view->form = $form;
            }

When I post an invalid form, the form does show up in the view like it's supposed to, but from the tutorials it seems like error messages should show up by default?

What am I missing?

Thank you for your help!

Upvotes: 3

Views: 366

Answers (1)

takeshin
takeshin

Reputation: 50638

The error messages are applied using Decorator Pattern. There are some Zend Form Element Decorators present in the form by default.

I guess you have overwritten the default decorators, using e.g. setDecorators().

Upvotes: 2

Related Questions