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 :)
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by Raül Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- Brett@brett.profitt

Brett - 0 likes
You must log in to post replies.The array elements need to be "Label" => "value" like you did in the first example. Yes, it feels (and arguably IS) backward..