Dynamic number of fields in Zend Form

105 Views Asked by At

So I'm trying to create a base form with Zend_Form, which I'm going to somehow map to a model.

The thing is that some properties of the model can have multiple values, for instance tags. One piece of content can have unlimited tags. How can I reflect this in Zend_Form. Would some kind of a JS-PHP combo be possible here? (I want people to have a plus sign which lets the add another textbox for a new tag)

1

There are 1 best solutions below

1
On BEST ANSWER
  1. Use subform for the tags
  2. Use js to clone html
  3. Once form is submitted count number of tags, and adjust form config before validation