function search_box

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()

search-block-form.tpl.php

Related topics

File

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

Code

function search_box($form, &$form_state, $form_id) {
  $form[$form_id] = array(
    '#type' => 'textfield',
    '#title' => t('Search'),
    '#title_display' => 'invisible',
    '#size' => 15,
    '#default_value' => '',
    '#attributes' => array('title' => t('Enter the terms 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;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!search!search.module/function/search_box/7.x