views:

19

answers:

1

I have a huge and complex form, and I have build it using Zend_Form. There are multiple places in the form where the user can add elements on click. Currently, if the user submits the form, and the validation fails - the elements added by the user are not retained - as they were not a part of the form. Is there a natural way to add them as a part of the form [emphasis on natural]?

A: 

Presumably you are adding new elements to the form using Js.

So you should use Js to populate some hidden field with information about what the user has added to the form. When the form is submitted read in this data and automatically re-add those form elements.

jakenoble