Re: Auto-add id to each FormBuilder element?
| From: | Justin Patrin | Date: | Fri, 05 May 2006 16:09:59 +0000 |
| Subject: | Re: Auto-add id to each FormBuilder element? | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-23965@lists.php.net to get a copy of this message | ||
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