search_box

Definition

search_box(&$form_state, $form_id)
modules/search/search.module, line 1060

Description

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

See also

search_box_form_submit()

@see theme_search_box_form()

Related topics

Namesort iconDescription
Form builder functionsFunctions that build an abstract representation of a HTML form.
Search interfaceThe Drupal search interface manages a global search mechanism.

Code

<?php
function search_box(&$form_state, $form_id) {
  $form[$form_id] = array(
    '#title' => t('Search this site'),
    '#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['#submit'][] = 'search_box_form_submit';
  $form['#validate'][] = 'search_box_form_validate';

  return $form;
}
?>
 
 

Drupal is a registered trademark of Dries Buytaert.