Zend_Form : Adding fields in sub-forms on user's click

Posted by anu iyer on Stack Overflow See other posts from Stack Overflow or by anu iyer
Published on 2010-01-14T20:59:51Z Indexed on 2010/03/31 6:03 UTC
Read the original article Hit count: 958

I'm having a zend form - comprised of a number of zend - sub forms, where the user is creating a new question (its a content management system). In one of the subforms, the user can click on a button to add more textfields, like this:

[----------] [----------] [click to add more]

which should give

[----------] [----------] [----------] [click to add more]

I'm trying to set a flag in the sub form in question - or set a count on how many times the button has been clicked, to add that many total fields to the subform - but its simply not working. I tried using a static count variable - but the value doesnt get incremented at all.

Any thoughts on how to do this in a Zend-subform within a zend form? I'll definitely update if I hit a solution. Thanks!

© Stack Overflow or respective owner

Related posts about zend-form-sub-form

Related posts about zend-form