You are here

function multiselect_fapi_example_display in Multiselect 7

Implementation of FAPI form.

1 string reference to 'multiselect_fapi_example_display'
multiselect_fapi_example_menu in multiselect_fapi_example/multiselect_fapi_example.module
Implements hook_menu() to set up the URLs (menu entries) for the form examples.

File

multiselect_fapi_example/multiselect_fapi_example.module, line 23

Code

function multiselect_fapi_example_display($form, &$form_state) {
  $form = array();
  $form['description'] = array(
    '#type' => 'item',
    '#title' => t('Simple form with a multiselect widget and a submit button. Saves to the variables table.'),
  );
  $form['multiselector'] = array(
    '#type' => 'multiselect',
    '#title' => t('Here is the multiselect'),
    '#options' => array(
      'title' => t('Titles only'),
      'teaser' => t('Titles plus teaser'),
      'fulltext' => t('Full text'),
      '1' => t('Option 1'),
      '2' => t('Option 2'),
      '3' => t('Option 3'),
      '4' => t('Option 4'),
      '5' => t('Option 5'),
      '6' => t('Option 6'),
      '7' => t('Option 7'),
      '8' => t('Option 8'),
      '9' => t('Option 9'),
      '10' => t('Option 10'),
      '11' => t('Option 11'),
      '12' => t('Option 12'),
    ),
    '#default_value' => _multiselect_fapi_example_options(),
    '#multiple' => TRUE,
    '#size' => 15,
    '#required' => TRUE,
  );
  $form = system_settings_form($form);
  return $form;
}