Re: again CustomForms on DO

From: Date: Mon, 01 Nov 2004 17:59:57 +0000
Subject: Re: again CustomForms on DO
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-15279@lists.php.net to get a copy of this message
On Mon, 1 Nov 2004 16:16:49 +0100, Alexander Petri <alex.petri@gmx.de> wrote: > now i have this code: > > $form =& $user->getCustomForm(); > $builder = & DB_DataObject_FormBuilder::create($user); > $builder->useForm($form); > $form =& $builder->getForm(); > if($form->validate()){ > $form->process(array(&$builder,'processForm'),false); > }else{ > require_once 'HTML/QuickForm/Renderer/Array.php'; > > $renderer =& new HTML_QuickForm_Renderer_Array(true, true); > $form->accept($renderer); > $smarty->assign('form', $renderer->toArray()); > } > > it renders and fills my CustomForm with data > but in the line > > $builder = & DB_DataObject_FormBuilder::create($user); > i create the "normal Form again"... > but how can i change this line so that i can only one Form I don't know what you mean here. Are you saying that the form gets generated twice? Ah, now I see I think.... Sorry about that, I forgot that FB doesn't check to make sure that the element isn't already in the form. > > another point is that my customForm dindnt get data from > my datetime field [birthday] > > thanks for help > Ok, let's try again. Why aren't you just using preDefElements? Why do you need a custom form? You *should* be able to make FB make whatever form you want with preDefElements, preDefOrder, and the other options. -- paperCrane --Justin Patrin--

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