I have taken the approach Sergey mentions on a few different forms. It is by
far the easiest method. The only drawback is that you have to impose a max
number of allowed dynamic fields. In most cases this is a good thing as you
probably don't want to allow anyone to add 100+ of any field.

An alternative is to pass the number of dynamic fields desired to the form
object when it is created. This way you can still use the built in form
validation. Then on the front end side, you would need to use javascript to
clone the dynamic field when a button is clicked (ex: "add email"), or you
would need to reload the page each time you need to add a field to recreate
the form. This method is much trickier.

Happy Coding,
James

On Thu, Jun 23, 2011 at 7:19 AM, Sergey Romanov <[email protected]> wrote:

> May be you can create those fields in form class but when you render it in
> vew render fild by field. And hide dynamic fields. Create links like "Add
> telephone", "Add address", ... and just unhide fields accordingly.
>
> -----
> Sincerely
> Sergey Romanov
>
> --
> View this message in context:
> http://zend-framework-community.634137.n4.nabble.com/How-would-you-handle-dynamic-forms-and-validation-tp3619115p3619524.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
> --
> List: [email protected]
> Info: http://framework.zend.com/archives
> Unsubscribe: [email protected]
>
>
>

Reply via email to