1 search.module search_box($form, &$form_state, $form_id)

Form builder; Output a search form for the search block's search box.

See also

search_box_form_submit()

Related topics

File

core/modules/search/search.module, line 1070
Enables site-wide keyword searching.

Code

function search_box($form, &$form_state, $form_id) {
  // The #required property is not set here, so that the user is taken to the
  // search page before any error is shown.
  $form[$form_id] = array(
    '#type' => 'search',
    '#title' => t('Search'),
    '#title_display' => 'invisible',
    '#size' => 15,
    '#default_value' => '',
    '#attributes' => array('title' => t('Enter the keywords you wish to search for.')),
  );
  $form['actions'] = array('#type' => 'actions');
  $form['actions']['submit'] = array('#type' => 'submit', '#value' => t('Search'));
  $form['#submit'][] = 'search_box_form_submit';

  return $form;
}