You are here

function theme_emailfield in Elements 7

Same name and namespace in other branches
  1. 6 elements.theme.inc \theme_emailfield()

Returns HTML for an emailfield 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_emailfield()
elements_element_info in ./elements.module
Implements hook_element_info().

File

./elements.theme.inc, line 21
The theme include file for the elements module.

Code

function theme_emailfield($variables) {
  $element = $variables['element'];
  $element['#attributes']['type'] = 'email';
  element_set_attributes($element, array(
    'id',
    'name',
    'value',
    'size',
    'maxlength',
    'placeholder',
  ));
  _form_set_class($element, array(
    'form-text',
    'form-email',
  ));
  $extra = elements_add_autocomplete($element);
  $output = '<input' . drupal_attributes($element['#attributes']) . ' />';
  return $output . $extra;
}