Dear Expression Engine members,
Does somebody know how I can use radio buttons as field_type with different values and keys.
This works:
function publish_tabs($channel_id, $entry_id = '')
{
$settings = array();
$existing_files = array('0','1');
$settings[] = array(
'field_id' => 'message_preview',
'field_label' => ee()->lang->line('tab_title'),
'field_required' => 'n',
'field_list_items' => $existing_files,
'field_data' => '0',
'field_instructions' => ee()->lang->line('tab_instructions'),
'field_pre_populate' => 'n',
'field_text_direction' => 'ltr',
'field_type' => 'radio',
'module_name' => 'Message Test'
);
return $settings;
}But how can I change the name? So that the value stays 0 or 1 but the message/ name is what I want, like:
<input type="radio" name="radio" value="0"> Water
<input type="radio" name="radio" value="1"> Juice
So that I can use my language file for the keys but not the values
I don’t think it is that difficult but I cannot find it somewhere..
Thanks in advance,
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.