diff --git a/templates/system/textfield.func.php b/templates/system/textfield.func.php
index 016e6ee..5877893 100644
--- a/templates/system/textfield.func.php
+++ b/templates/system/textfield.func.php
@@ -19,7 +19,11 @@ function bootstrap_textfield($variables) {
   ));
   _form_set_class($element, array('form-text'));
 
-  $output = '<input' . drupal_attributes($element['#attributes']) . ' />';
+  $attributes = array();
+  foreach ($element['#attributes'] as $attribute => $values) {
+    $attributes[$attribute] = $values;
+  }
+  $output = '<input' . drupal_attributes($attributes) . ' />';
 
   $extra = '';
   if ($element['#autocomplete_path'] && drupal_valid_path($element['#autocomplete_path'])) {
