Re: Adding Elements dynamically in HTML_QuickForm_Controller?
| From: | John Stoffel | Date: | Fri, 23 Apr 2004 23:06:12 +0000 |
| Subject: | Re: Adding Elements dynamically in HTML_QuickForm_Controller? | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-28307@lists.php.net to get a copy of this message | ||
>>>>> "Bertrand" == Bertrand Mansion <bmansion@mamasam.com> writes:
Bertrand> Are you looking for something like a 'repeat' element that
Bertrand> would display rows using a predefined model along with 'add'
Bertrand> and 'delete' buttons ?
That sounds more like what I'm looking for. Basically, the idea is
that on a page of a set of data entry forms, a user could
add/delete/edit a variable number of the same type of fields.
In this case, each record can have zero or more References to other
names that is person/org is known as.
So some easy way to define an array (group?) of elements that can be
grown/shrunk. I sorta have something working, but I haven't figured
out how to keep track of the size of the array. Looking at the
QuickForm docs, it looks like I can add/delete elements from an array.
Now to just figure out how to make it all dynamic. I don't care what
the indexes are in the arrays, just as long as empty entries don't
show up when I loop over the array at the end.
Take a look at:
http://jfs.ecotarium.org/AAS/john/QF/my-tabbed.php
for my initial stabs at this. I have to say that the
QuickForm_Controller stuff has made this much easier to get going so
far! This is only a couple of hours of hacking on my part, not
knowing PHP well...
Thanks for the quick reply Bertrand!
John