Closed (fixed)
Project:
Drupal core
Version:
4.7.2
Component:
forms system
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
11 Jun 2006 at 14:03 UTC
Updated:
24 Jan 2007 at 12:46 UTC
I have two user defined elements:
hook_elements() {
...
$type['grid'] = array (
'#tree' => TRUE,
);
$type['listbox'] = array(
'#input' => TRUE,
'#tree' => TRUE,
);
...
return $type
}
so far so good but when I want to use the types like the next example:
$form['test_grid'] = array(
'#name' => 'test_grid',
'#type' => 'grid',
'#title' => t('Grid test'),
);
$form['test_grid']['lb1'] = array(
'#name' => 'lb1',
'#type' => 'listbox',
'#options' => array('optie 1', 'optie 2', 'optie 3'),
);
the second type (listbox) does not show up. It shows up when I remove test_grid from the type. But I want to use variant in the example. Can anybody tell me how to use 'nested' elements?
Comments
Comment #1
estraver commentedanybody?
Comment #2
nevets commentedHere is an example of grouped elements (sort of nested) using the fieldset element
Comment #3
estraver commentedThanx, but that's not what I want. That works for the default elements fieldset, but I want that it works with my defined elements. So, if I want to use the group structure
$form['a']['b']with my own types grid and listbox (see first post) it doesn't work, but when I don't use a group like$form['a']it works. There must be a reason why it doesn't work with my defined elements.Hopefully someone can give some advise or an example how has to be.
Comment #4
magico commentedClosing support request older than 1 month.
Comment #5
(not verified) commented