RE: [PEAR] Auto-add id to each FormBuilder element?

From: Date: Fri, 05 May 2006 17:21:22 +0000
Subject: RE: [PEAR] Auto-add id to each FormBuilder element?
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-23972@lists.php.net to get a copy of this message
Beaut i'll give that a try on monday and see if I can make something happen. Thanks for the code... -----Original Message----- From: Justin Patrin [mailto:papercrane@gmail.com] Sent: Fri 5/5/2006 12:09 To: Wright Zane A A1C 30 IS/DOMM Cc: pear-general@lists.php.net Subject: Re: [PEAR] Auto-add id to each FormBuilder element? On 5/5/06, Wright Zane A A1C 30 IS/DOMM <Zane.Wright@langley.af.mil> wrote: > Sorry for all the msg's recently, but I am finally able to make progress > with all these projects here. But is there any quick or easy or even > difficult way to have each form element automatically use the name as > the id? I am trying to use xajax to update each element but only IE can > reference the name, but if I could get the id created also that would > greatly expand the capabilities of what I'm building. Any ideas? > Suggestions? Or should I forget about it? ;) Thanks. > This is yet another of those things that has been asked for many times but never added to QF. I know, once again, that someone has implemented these things before, but I don't know where the code is. This should be fairly simple to do, though. One quick hack would be to: foreach (array_keys($form->_elements) as $key) { $form->_elements[$key]->updateAttributes(array('id' => $form->_elements[$key]->getName())); } Another way to do this would be to have FB's QF driver set the IDs as it creates the elements. -- Justin Patrin

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