Drupal Forms API checkboxes example basic
I am learning to develop modules in drupal, and intend to document my learning process.
So here it is basic clear example of how to add checkboxes to your form in the admin settings page of your module:
function onthisdate_admin() {
$form['fd_boxes'] = array
(
'#type' => 'checkboxes',
'#options' => array
(
15 => 'a',
20 => 'b',
25 => 'c',
),
'#default_value' => variable_get('fd_boxes', 0),
);
return system_settings_form($form);
}
Click here for my source and further details
Note: “onthisdate” is the name of my test module. Rename it to your module name. If you are new to module development, click here to get the basic info.