Re: Creating multiple elements of the same fields into an array with FormBuilder
| From: | Dan Rossi | Date: | Tue, 25 Oct 2005 11:07:44 +0000 |
| Subject: | Re: Creating multiple elements of the same fields into an array with FormBuilder | ||
| References: | 1 2 3 4 5 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-21631@lists.php.net to get a copy of this message | ||
I dont use formbuilder to post process the data into records , as i handle these in a post request method which does other processing. But ill take a look at those possibilities. As for an array elementname, quickform wont let you do it no, it craps out.
On 25/10/2005, at 2:00 AM, Justin Patrin wrote:
On 10/24/05, Dan Rossi <pear@electroteque.org> wrote:On 23/10/2005, at 4:26 AM, Justin Patrin wrote: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 -- PEAR General Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.phpUmm 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 ?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