PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » HTML » HTML_QuickForm2 » Bug #1681

Better access to grouped elements

Details

Request #1681Better access to grouped elements
Submitted2004-06-19 11:41 UTC
Fromfd at pyoworks dot com
Assignedavb
StatusClosed
PackageHTML_QuickForm2
PHP VersionIrrelevant
OSlinux
Roadmaps0.1.0

Comments

[2004-06-19 11:41 UTC] fd at pyoworks dot com

Description:
------------
Hi,
it would be nice if there was better access to grouped
elements.

E.g. $form->getElement("element_name") does not work if
the "element_name" Element is part of a group.

Also, it should be possible to add and delete elements
to/from created groups.

Anyway, nice work :)

Florian

[2004-09-09 13:17 UTC] frutik at ukr dot net

This patch to group.php is usefull for me to access to grouped elements.

**
* Gets the grouped elements by variable name
*
* @since hack
* @access public
* @return false, reference or array of references to group's elements
*/

function &getGroupElement($search)
{
$return = false;

foreach($this->_elements as $i => $element)
{
if ( $element->_attributes["name"] == $search)
{
$return[] =& $this->_elements[$i];
}
}

if ( is_array($return) && count($return) == 1 )
{
return $return[0];
}

return $return;
}