Re: reorder the elements of a quickform

From: Date: Wed, 06 Oct 2004 19:53:29 +0000
Subject: Re: reorder the elements of a quickform
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-14776@lists.php.net to get a copy of this message
On Wed, 6 Oct 2004 14:35:05 +0200, mike <laurent.ludovic@free.fr> wrote: > Hi! > > I would like reorder the elements of my quickform, here's my code : I have > my database elements and I add some elements with addElement function, I > would like that these elements are placed before. Wow, another person who wants my patch in QF... > I used the patch for reorder the elements but he seems not to function ! > Some elements are duplicated after use the moveElementAfter function three > times. Hmmm, I haven' t heard of anything like this. I'm using this patch myself and have seen no problems like this. Are you using PHP4 or PHP5? Could you give me some simple HTML_QuickForm-only code which reproduces this problem? > Why this functionnality does not exist in HTML_QUICK_FORM? Because it hasn't been added yet. > it's very important. I agree, that's why I wrote the patch. > I use the version 2.0 of HTML_QUICK_FORM (cvs version) > function preGenerateForm(){ > > $el['objet'] = &HTML_QuickForm::createElement('textarea', > 'objet',"Objet"); > > ...... > > $this->fb_preDefElements = &$el; > > } > > function postGenerateForm(&$form) > > { > > $this->removeElement(&$form); > > $this->urlList="g2i/apindex&id=".$this->aapc_code; > > if(isset($_GET['id'])){ > > $this->urlList="g2i/apindex&id=".$_GET['id']; > > } > > $group1[] = > > &HTML_QuickForm::createElement("text","opclassprincipale",""); > > $group1[] = > > &HTML_QuickForm::createElement("text","opclasssupplementaire1","", > array('size' => 10)); > > $group1[] = > > &HTML_QuickForm::createElement("text","opclasssupplementaire2","", > array('size' => 10)); > > $group1[] = > > &HTML_QuickForm::createElement("text","opclasssupplementaire3","", > array('size' => 10)); > > $form->addGroup($group1,"bloc1", 'Objet principal', ''); > > } > > $form->moveElementAfter('label1','objet'); > > $form->moveElementAfter('label2','conceptionrealisation'); > > } > -- paperCrane --Justin Patrin--

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