You are here

function theme_numericfield in Format Number API 7

Same name and namespace in other branches
  1. 6 format_number.module \theme_numericfield()

Render a numeric form element.

Parameters

$element: An associative array containing the properties of the element.

Return value

A themed HTML string representing the input element.

1 theme call to theme_numericfield()
format_number_element_info in ./format_number.module
Implements hook_element_info().

File

./format_number.module, line 564
This module provides a method to configure number formats (site default and user defined) with configurable decimal point and thousand separators. It also exposes several functions that can be used by other contributed or custom modules to display…

Code

function theme_numericfield($variables) {
  format_number_add_js();
  $element =& $variables['element'];
  $element['#attributes']['type'] = 'text';
  element_set_attributes($element, array(
    'id',
    'name',
    'value',
    'size',
    'maxlength',
  ));
  _form_set_class($element, array(
    'form-text',
    'form-numeric',
  ));
  $variables['element']['#children'] = '<input' . drupal_attributes($element['#attributes']) . ' />';
  return theme('form_element', $variables);
}