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. 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
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top