diff --git a/includes/form.inc b/includes/form.inc
index 442016a..fac7720 100644
--- a/includes/form.inc
+++ b/includes/form.inc
@@ -2739,6 +2739,7 @@ function form_process_password_confirm($element) {
     '#title' => t('Password'),
     '#value' => empty($element['#value']) ? NULL : $element['#value']['pass1'],
     '#required' => $element['#required'],
+    '#autocomplete' => empty($element['#autocomplete']) ? NULL : $element['#autocomplete'],
     '#attributes' => array('class' => array('password-field')),
   );
   $element['pass2'] =  array(
@@ -2746,6 +2747,7 @@ function form_process_password_confirm($element) {
     '#title' => t('Confirm password'),
     '#value' => empty($element['#value']) ? NULL : $element['#value']['pass2'],
     '#required' => $element['#required'],
+    '#autocomplete' => empty($element['#autocomplete']) ? NULL : $element['#autocomplete'],
     '#attributes' => array('class' => array('password-confirm')),
   );
   $element['#element_validate'] = array('password_confirm_validate');
@@ -3660,14 +3662,14 @@ function theme_hidden($variables) {
  *   An associative array containing:
  *   - element: An associative array containing the properties of the element.
  *     Properties used: #title, #value, #description, #size, #maxlength,
- *     #placeholder, #required, #attributes, #autocomplete_path.
+ *     #placeholder, #autocomplete, #required, #attributes, #autocomplete_path.
  *
  * @ingroup themeable
  */
 function theme_textfield($variables) {
   $element = $variables['element'];
   $element['#attributes']['type'] = 'text';
-  element_set_attributes($element, array('id', 'name', 'value', 'size', 'maxlength', 'placeholder'));
+  element_set_attributes($element, array('id', 'name', 'value', 'size', 'maxlength', 'placeholder', 'autocomplete'));
   _form_set_class($element, array('form-text'));
 
   $extra = '';
@@ -3695,7 +3697,7 @@ function theme_textfield($variables) {
  * @param $variables
  *   An associative array containing:
  *   - element: An associative array containing the properties of the element.
- *     Properties used: #action, #method, #attributes, #children
+ *     Properties used: #action, #method, #attributes, #children, #autocomplete
  *
  * @ingroup themeable
  */
@@ -3704,7 +3706,7 @@ function theme_form($variables) {
   if (isset($element['#action'])) {
     $element['#attributes']['action'] = drupal_strip_dangerous_protocols($element['#action']);
   }
-  element_set_attributes($element, array('method', 'id'));
+  element_set_attributes($element, array('method', 'id', 'autocomplete'));
   if (empty($element['#attributes']['accept-charset'])) {
     $element['#attributes']['accept-charset'] = "UTF-8";
   }
@@ -3751,14 +3753,14 @@ function theme_textarea($variables) {
  *   An associative array containing:
  *   - element: An associative array containing the properties of the element.
  *     Properties used: #title, #value, #description, #size, #maxlength,
- *     #placeholder, #required, #attributes.
+ *     #placeholder, #autocomplete, #required, #attributes.
  *
  * @ingroup themeable
  */
 function theme_password($variables) {
   $element = $variables['element'];
   $element['#attributes']['type'] = 'password';
-  element_set_attributes($element, array('id', 'name', 'size', 'maxlength', 'placeholder'));
+  element_set_attributes($element, array('id', 'name', 'size', 'maxlength', 'placeholder', 'autocomplete'));
   _form_set_class($element, array('form-text'));
 
   return '<input' . drupal_attributes($element['#attributes']) . ' />';
diff --git a/modules/simpletest/tests/form.test b/modules/simpletest/tests/form.test
index 71187b5..33084e6 100644
--- a/modules/simpletest/tests/form.test
+++ b/modules/simpletest/tests/form.test
@@ -387,6 +387,37 @@ class FormElementTestCase extends DrupalWebTestCase {
   }
 
   /**
+   * Tests autocomplete for form, textfield, and password.
+   */
+  function testAutocomplete() {
+    $this->drupalGet('form-test/autocomplete');
+    $expected = 'off';
+
+    // Test to make sure that form has autocomplete set to "off".
+    $element = $this->xpath('//form[@id=:id and @autocomplete=:expected]', array(
+      ':id' => 'form-test-autocomplete-test',
+      ':expected' => $expected,
+    ));
+    $this->assertTrue(!empty($element), t('Autocomplete set to "off" on form.'));
+
+    // Test to make sure that textfield has autocomplete set to "off".
+    $element = $this->xpath('//input[@id=:id and @autocomplete=:expected]', array(
+      ':id' => 'edit-textfield',
+      ':expected' => $expected,
+    ));
+    $this->assertTrue(!empty($element), t('Autocomplete set to "off" on textfield.'));
+
+    // Test to make sure that password has autocomplete set to "off".
+    for (i = 1; i <= 2; i++) {
+      $element = $this->xpath('//input[@id=:id and @autocomplete=:expected]', array(
+        ':id' => 'edit-password-confirm-pass' . i,
+        ':expected' => $expected,
+      ));
+      $this->assertTrue(!empty($element), t('Autocomplete set to "off" on password @id.', array('id' => i)));
+    }
+  }
+
+  /**
    * Tests placeholder text for textfield, password, and textarea.
    */
   function testPlaceHolderText() {
diff --git a/modules/simpletest/tests/form_test.module b/modules/simpletest/tests/form_test.module
index a934816..d2a903d 100644
--- a/modules/simpletest/tests/form_test.module
+++ b/modules/simpletest/tests/form_test.module
@@ -105,6 +105,12 @@ function form_test_menu() {
     'page arguments' => array('form_test_select'),
     'access callback' => TRUE,
   );
+  $items['form-test/autocomplete'] = array(
+    'title' => 'Autocomplete',
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('form_test_autocomplete_test'),
+    'access callback' => TRUE,
+  );
   $items['form-test/placeholder-text'] = array(
     'title' => 'Placeholder',
     'page callback' => 'drupal_get_form',
@@ -987,6 +993,29 @@ function form_test_select_submit($form, &$form_state) {
 }
 
 /**
+ * Builds a form to test the autocomplete attribute.
+ */
+function form_test_autocomplete_test($form, &$form_state) {
+  $form = array(
+    '#autocomplete' => 'off',
+  );
+
+    $form['textfield'] = array(
+    '#type' => 'textfield',
+    '#title' => 'textfield',
+    '#autocomplete' => 'off',
+  );
+
+  $form['password_confirm'] = array(
+    '#type' => 'password_confirm',
+    '#title' => 'password_confirm',
+    '#autocomplete' => 'off',
+  );
+
+  return $form;
+}
+
+/**
  * Builds a form to test the placeholder attribute.
  */
 function form_test_placeholder_test($form, &$form_state) {
