function form_pre_render_textfield

Prepares a #type 'textfield' render element for theme_input().

Parameters

array $element: An associative array containing the properties of the element. Properties used: #title, #value, #description, #size, #maxlength, #placeholder, #required, #attributes.

Return value

array The $element with prepared variables ready for theme_input().

Related topics

1 string reference to 'form_pre_render_textfield'
system_element_info in drupal/core/modules/system/system.module
Implements hook_element_info().

File

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

Code

function form_pre_render_textfield($element) {
  $element['#attributes']['type'] = 'text';
  element_set_attributes($element, array(
    'id',
    'name',
    'value',
    'size',
    'maxlength',
    'placeholder',
  ));
  _form_set_attributes($element, array(
    'form-text',
  ));
  return $element;
}