Hi, being not an experienced drupal developer, here is my query. Within the hook_form() of my module, I define a "radios" form element:
$form['cocivote'] = array(
'#type' => 'radios',
'#title' => t('Rate This'),
'#default_value' => '2',
'#theme' => 'radios5starvote',
'#description' => t(''),
'#options' => array('1','2','3','4','5'),
'#weight' => 6,
'#required' => TRUE);
As you noticed, I want a custom theme function to format the output for this radios. So, in my template.php (PHPTemplate engine), I define the radios5starvote as follows:
function phptemplate_radios5starvote($element){
// here comes custom output
}
Now, my problem is the following: the radios element is a grouped element, i.e. containing multiple '#title' fields, multiple '#required' fields etc. For instance, the parent element has a '#title' fields and also every radio element has a '#title' field as well.
For my output though, I need to be able to process the element and retrieve e.g. the title of the parent only (to output as the title of all radios). As the form array is flattened, I don't see how to be able to access the desired title field. Are there any FORMS API functions that provide such functionality?