1.20.x form.inc theme_number($variables)

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, #size, #min, #max, #placeholder, #required, #attributes, #step.

Related topics

File

includes/form.inc, line 4553
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', 'size', 'step', 'min', 'max', 'maxlength', 'placeholder'));
  _form_set_class($element, array('form-number'));

  return '<input' . backdrop_attributes($element['#attributes']) . ' />' . backdrop_render_children($element);
}