Same name and namespace in other branches
  1. 4.7.x modules/search.module \search_box()
  2. 6.x modules/search/search.module \search_box()
  3. 7.x modules/search/search.module \search_box()

Output a search form for the search block and the theme's search box.

Related topics

1 string reference to 'search_box'
search_forms in modules/search/search.module

File

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

Code

function search_box($form_id) {

  // Use search_keys instead of keys to avoid ID conflicts with the search block.
  $form[$form_id . '_keys'] = array(
    '#type' => 'textfield',
    '#size' => 15,
    '#default_value' => '',
    '#attributes' => array(
      'title' => t('Enter the terms you wish to search for.'),
    ),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Search'),
  );
  $form['#base'] = 'search_box_form';
  return $form;
}