diff --git a/core/includes/form.inc b/core/includes/form.inc
index 00f9533..8065b25 100644
--- a/core/includes/form.inc
+++ b/core/includes/form.inc
@@ -3762,10 +3762,24 @@ function theme_textarea($variables) {
     $wrapper_attributes['class'][] = 'resizable';
   }
 
+  $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 = '<div' . drupal_attributes($wrapper_attributes) . '>';
   $output .= '<textarea' . drupal_attributes($element['#attributes']) . '>' . check_plain($element['#value']) . '</textarea>';
   $output .= '</div>';
-  return $output;
+  return $output . $extra;
 }
 
 /**
diff --git a/core/modules/system/system.module b/core/modules/system/system.module
index e2e16ae..fc97f31 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -385,6 +385,7 @@ function system_element_info() {
     '#cols' => 60,
     '#rows' => 5,
     '#resizable' => TRUE,
+    '#autocomplete_path' => FALSE,
     '#process' => array('ajax_process_form'),
     '#theme' => 'textarea',
     '#theme_wrappers' => array('form_element'),
