function theme_textfield

cis7 form.inc theme_textfield($variables)
cle7 form.inc theme_textfield($variables)
elmsmedia7 form.inc theme_textfield($variables)
icor7 form.inc theme_textfield($variables)
meedjum_blog7 form.inc theme_textfield($variables)
mooc7 form.inc theme_textfield($variables)

Returns HTML for a textfield form element.

Parameters

$variables: An associative array containing:

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

Related topics

1 theme call to theme_textfield()
theme_date_textfield_element in sites/all/modules/ulmus/date/date_api/theme/theme.inc
Returns HTML for a date textfield input form element.
538 string references to the theme hook from theme_textfield()

Note: this list is generated by looking for the string for this theme hook, so it may include some references that are not actually using this theme hook.

accessibility_admin_filter_form in sites/all/modules/ulmus/accessibility/accessibility.admin.inc
Form to filter accessibility tests.
accessibility_content_admin_form in sites/all/modules/ulmus/accessibility/modules/accessibility_content/accessibility_content.admin.inc
accessibility_handler_link_field::options_form in sites/all/modules/ulmus/accessibility/views/accessibility_handler_link_field.inc
accessibility_test_add_form in sites/all/modules/ulmus/accessibility/accessibility.module
Form for saving accessibiliy test entities.
accessibility_test_edit_form in sites/all/modules/ulmus/accessibility/accessibility.module
Edit form for accessibility tests.

... See full list

File

includes/form.inc, line 3863
Functions for form and batch generation and processing.

Code

function theme_textfield($variables) {
  $element = $variables['element'];
  $element['#attributes']['type'] = 'text';
  element_set_attributes($element, array('id', 'name', 'value', 'size', 'maxlength'));
  _form_set_class($element, array('form-text'));

  $extra = '';
  if ($element['#autocomplete_path'] && drupal_valid_path($element['#autocomplete_path'])) {
    drupal_add_library('system', 'drupal.autocomplete');
    $element['#attributes']['class'][] = 'form-autocomplete';

    $attributes = array();
    $attributes['type'] = 'hidden';
    $attributes['id'] = $element['#attributes']['id'] . '-autocomplete';
    $attributes['value'] = url($element['#autocomplete_path'], array('absolute' => TRUE));
    $attributes['disabled'] = 'disabled';
    $attributes['class'][] = 'autocomplete';
    $extra = '<input' . drupal_attributes($attributes) . ' />';
  }

  $output = '<input' . drupal_attributes($element['#attributes']) . ' />';

  return $output . $extra;
}