function theme_number

Returns HTML for a number 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.

Related topics

1 theme call to theme_number()
system_element_info in drupal/core/modules/system/system.module
Implements hook_element_info().

File

drupal/core/includes/form.inc, line 4114
Functions for form and batch generation and processing.

Code

function theme_number($variables) {
  $element = $variables['element'];
  $element['#attributes']['type'] = 'number';
  element_set_attributes($element, array(
    'id',
    'name',
    'value',
    'step',
    'min',
    'max',
    'placeholder',
  ));
  _form_set_attributes($element, array(
    'form-number',
  ));
  $output = '<input' . new Attribute($element['#attributes']) . ' />';
  return $output;
}