Re: Creating multiple elements of the same fields into an array with FormBuilder
| From: | Dan Rossi | Date: | Mon, 24 Oct 2005 09:03:46 +0000 |
| Subject: | Re: Creating multiple elements of the same fields into an array with FormBuilder | ||
| References: | 1 2 3 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-21611@lists.php.net to get a copy of this message | ||
On 23/10/2005, at 4:26 AM, Justin Patrin wrote:
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 ?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