Add radiobutton to hook_form
I want to add radiobuttons to my module. How can I add using Add radiobutton to hoo开发者_如何学运维k_form?
function mymodule_some_form($form_state) {
$form['radio'] = array(
'#type' => 'radios',
'#title' => 'Title',
'#options' => array(0 => 'First', 1 => 'Second', 3 => 'Third'),
'#attributes' => array('style' => 'display:inline-block;')
);
$form['select'] = array(
'#type' => 'select',
'#title' => 'Title',
'#options' => array(0 => 'First', 1 => 'Second', 3 => 'Third'),
'#attributes' => array('style' => 'display:inline-block;')
);
}
See the Drupal FAPI Documentation for more information.
精彩评论