function theme_telfield in Elements 7
Same name and namespace in other branches
- 6 elements.theme.inc \theme_telfield()
Returns HTML for a telfield 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.
1 theme call to theme_telfield()
- elements_element_info in ./
elements.module - Implements hook_element_info().
File
- ./
elements.theme.inc, line 67 - The theme include file for the elements module.
Code
function theme_telfield($variables) {
$element = $variables['element'];
$element['#attributes']['type'] = 'tel';
element_set_attributes($element, array(
'id',
'name',
'value',
'size',
'maxlength',
'placeholder',
));
_form_set_class($element, array(
'form-text',
'form-tel',
));
$extra = elements_add_autocomplete($element);
$output = '<input' . drupal_attributes($element['#attributes']) . ' />';
return $output . $extra;
}