Re: Formbuilder and multiple forms

From: Date: Fri, 18 Mar 2005 05:40:13 +0000
Subject: Re: Formbuilder and multiple forms
References: 1 2 3  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-36747@lists.php.net to get a copy of this message
On Fri, 18 Mar 2005 02:33:39 +0100, Esad Hajdarevic <esad-public@25novembar.com> wrote: > > Or even by creating the form yourself and using useForm(). > > That's would be too much overhead every time you use multiple forms. > 2 extra lines per form. $form = new HTML_QuickForm(...); $fb->useForm($form); before $form = $fb->getForm(); > > > Well, FormBuilder normally deals with one form, so we didn't really > > think about it. > > Well, why not make it "multi-form" compatible? > As long as it has no side-effects. Do you know of any? > > It could be possible to turn this on by default instead and make the > > user use getForm if they want it off....I'm not sure if there are any > > side-effects of using this, but I don' thitnk there are any. > > I've tried this (the other way round, with setting trackSubmit to true), > but the form seems to be already rendered/configured without the > trackSubmit, so changing this property afterwards won't do the trick. > You can only set trackSubmit when the form is created (a design defect, I suppose). So you have to use useForm(). It's only 1 line more than setting it afterward would be (if you could). > This is really an one-liner: > > FormBuilder/QuickForm.php (v 1.32 2005/03/05 00:22:51 justinpatrin): > > 157: $form =& new HTML_QuickForm($formName, $method, $action, > $target,"",true); > > instead of > > 157: $form =& new HTML_QuickForm($formName, $method, $action, $target); True, but what if someone doesn't *want* to have trackSubmit true. I can't think of any reason not to off hand, but I'm sure they exist. Perhaps we can expand the parameters to getForm.... > > Sorry for being lazy and not creating a dif. > -- Justin Patrin

« previous php.pear.dev (#36747) next »