Php – zend framework empty form after submit

PHPzend-formzend-framework

I have a form based on Zend_Form.
When form isn't valid, my inputs contain data.
But if all OK, after submiting form conains all data.

I know how clear form with help of jQuery.
But how I make it in Zend Framework?

Best Answer

In your controller, after you have checked that your form is submitted and valid, and you have handled the data, you can try:

$form->reset();

in order to clean the form. More info in the ZF manual here: http://framework.zend.com/manual/en/zend.form.forms.html#zend.form.forms.elements.values

Related Topic