Re: Creating multiple elements of the same fields into an array with FormBuilder

From: Date: Thu, 27 Oct 2005 10:51:56 +0000
Subject: Re: Creating multiple elements of the same fields into an array with FormBuilder
References: 1 2 3 4 5 6 7  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-21674@lists.php.net to get a copy of this message
On 26/10/2005, at 2:21 AM, Justin Patrin wrote:
I suggest if you're using FormBuilder to create the form you also do processing with it. You can always do other things with the data as well. Take a look at pre and postProcessFormCallback.
Actually, yes it will. require_once('HTML/QuickForm.php'); $form = new HTML_QuickForm(); $form->addElement('text', 'arr[]', 'Element 0'); $form->addElement('text', 'arr[]', 'Element 1'); $form->addElement('text', 'arr[]', 'Element 2'); $form->display(); "It craps out" isn't a very good explanation. What *exactly* happens. QF won't let you, for example, use the same element name for different element *types*. But it's fine in the above example.
Ok yes that works i meant in formbuilder. Anyway is there a subForm example i can work off ? In particular im not displaying a list of current records, but for the insertion page a changable list of elements to insert records into the track titles table. That is you can update how many rows/elements to display and insert hence the elementnames with [] appended to them is the best solution i think unless FB can handle it ? I may aswell just use standard html form elements inside the template ?

« previous php.pear.general (#21674) next »