HTML_QuickForm - Assign a filter to a group element

From: Date: Tue, 24 Feb 2004 07:13:08 +0000
Subject: HTML_QuickForm - Assign a filter to a group element
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-10889@lists.php.net to get a copy of this message
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... Torsten

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