Re: Creating multiple elements of the same fields into an array with FormBuilder
| From: | Justin Patrin | Date: | Mon, 24 Oct 2005 16:00:30 +0000 |
| Subject: | Re: Creating multiple elements of the same fields into an array with FormBuilder | ||
| References: | 1 2 3 4 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-21613@lists.php.net to get a copy of this message | ||
On 10/24/05, Dan Rossi <pear@electroteque.org> wrote:
>
> On 23/10/2005, at 4:26 AM, Justin Patrin wrote:
>
> >>>
> >>>
> >
> > My advice is not to use an array and to use SubForm with multiple FBs,
> > one for each record. Use an elementNamePrefix and/or
> > elementNamePostfix to differentiate them. (*not* [] or anything with [
> > or ], use a normal string like _record_$n). If you need it to display
> > in a table you can try to alter the QF renderer to display it
> > differently (although I'm not sure how well this will work due to
> > SubForm's hacked display methods).
> >
> > The other option would be to create an FB and form for each song, then
> > extract the elements and insert them into a table. I would suggest
> > trying FB's ElementTable for this.
> >
> > --
> > Justin Patrin
> >
>
>
> Umm im a bit vague what you mean, but i can take a look, i seriously
> dont think data to extra into the db is easier using fieldname_record_1
> rather than fieldname[] , as it creates an array which u can loop
> through and insert/update . Quickform doesnt seem to let you do this,
> is this a flaw ?
>
If you're using FormBuilder it's automatic, you don't have to loop
through anything.
QF will let you do such a thing, but it may not allow you to do it in
groups....I'm really not sure.
--
Justin Patrin