Home » HTML » HTML_QuickForm2 » Bug #1681
Better access to grouped elements
Details
| Request #1681 | Better access to grouped elements |
|---|---|
| Submitted | 2004-06-19 11:41 UTC |
| From | fd at pyoworks dot com |
| Assigned | avb |
| Status | Closed |
| Package | HTML_QuickForm2 |
| PHP Version | Irrelevant |
| OS | linux |
| Roadmaps | 0.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;
}