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