search_box

Versions
4.7
search_box($form_id = 'search_theme_form')
5
search_box($form_id)
6
search_box(&$form_state, $form_id)
7
search_box($form, &$form_state, $form_id)

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

Related topics

Code

modules/search/search.module, line 1036

<?php
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;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.