Zend Form storing error results in sessions
I'm getting some strange behaviour with my form (using Zend Form). I have a login and register fo开发者_如何学编程rm, if you submit these forms and cause an error, the error message does not go away even after you close the page. It seems that it is being stored in session variables. I have tried using $form->clearErrorMessages();
but to no avail.
Please see the attached screenshot here.
Thanks.
No, I bet you just validating it in wrong way.
For first you have to check whether you have a post request or not, and after that - validate the form
if ($this->_request->isPost() && $form->isValid($this->_request->getPost())) {
$values = $form->getValues();
}
精彩评论