When the theme is switched on, autocomplete on textfields don't work.

The issue seems to come from the "textfield.func.php" file, function gumby_textfield($variables).

This theme is really nice to work with!

Comments

Joe_Smith’s picture

Here is a gumby_textfield function (in textfield.func.php) that works:

function gumby_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 text input textfield'));

  $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;
}

I should add that the standard autocomplete throbber doesn't fit the textfields. This can be replaced using css as described here, for example: http://blog.japenga.eu/post/45833253002/sick-of-drupals-default-throbber-breaking