Input Radio and Array

 

Hi, this was the code I was using to create an input radio

<?php echo elgg_view('input/radio', array(

'name' => 'rdTipologia',

'id' => 'rdTipologia',

"js" => "onclick='HiddenSubmitRegister();'",

'options' => array('Azienda' => '2', 'Agente' => '1'),

));

?>

the result was that the value of the input radio was 2 and had the labelas value 'Azienda'

Then I did so

 

if($types = elgg_get_entities($types_options)){

$types_options_values = array();

foreach($types as $type){

$types_options_values[$type->guid] = $type->getTitle();

}

then

 

<?php echo elgg_view('input/radio', array(

'name' => 'rdTipologia',

'id' => 'rdTipologia',

"js" => "onclick='HiddenSubmitRegister();'",

'options' => $types_options_values,

));

?>

but il value the input radio is $type->getTitle(), How can I make the value of radio input is $type->guid?

 

Thank all :)

 

 

 

Feedback and Planning

Feedback and Planning

Discussions about the past, present, and future of Elgg and this community site.