function theme_searchfield in Elements 7
Same name and namespace in other branches
- 6 elements.theme.inc \theme_searchfield()
Returns HTML for a searchfield form element.
Parameters
$variables: An associative array containing:
- element: An associative array containing the properties of the element. Properties used: #title, #value, #description, #size, #maxlength, #placeholder, #required, #attributes, #autocomplete_path.
1 theme call to theme_searchfield()
- elements_element_info in ./
elements.module - Implements hook_element_info().
File
- ./
elements.theme.inc, line 44 - The theme include file for the elements module.
Code
function theme_searchfield($variables) {
$element = $variables['element'];
$element['#attributes']['type'] = 'search';
element_set_attributes($element, array(
'id',
'name',
'value',
'size',
'maxlength',
'placeholder',
));
_form_set_class($element, array(
'form-text',
'form-search',
));
$extra = elements_add_autocomplete($element);
$output = '<input' . drupal_attributes($element['#attributes']) . ' />';
return $output . $extra;
}