Re: HTML_QuickForm - Assign a filter to a group element

From: Date: Tue, 24 Feb 2004 09:29:25 +0000
Subject: Re: HTML_QuickForm - Assign a filter to a group element
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-10890@lists.php.net to get a copy of this message
<torsten.pohl@gmx.net> wrote : > Hi, > > I have the following problem with PEAR::HTML_QuickForm and the > simplified example code: > > $elements = array(); > $elements[] = &HTML_QuickForm::createElement('text', 'element1'); > $elements[] = &HTML_QuickForm::createElement('text', 'element2'); > $group = $form->addGroup($elements, 'group'); > > How can I assign a _filter_ (not a rule) to a group element? Adding the line > > $form->applyFilter('element2', 'trim'); > > results in the error message > > QuickForm Error: nonexistent html element > Element 'element2' does not exist in HTML_QuickForm::applyFilter() > > Can anybody tell me how I have to address the group element to add a filter? > > Thanks in advance... Hi, Did you try the following ? $form->applyFilter('group[element2]', 'trim'); Bertrand Mansion Mamasam

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