diff --git a/cck_select_other.module b/cck_select_other.module
index ac8404b..a36a0a8 100644
--- a/cck_select_other.module
+++ b/cck_select_other.module
@@ -218,7 +218,7 @@ function cck_select_other_widget_validate($element, &$form_state) {
 
   // Empty other field.
   if ($field[$langcode]['instance']['required'] && $form_state['values'][$field_name][$langcode][$delta]['select_other_list'] == 'other' && empty($form_state['values'][$field_name][$langcode][$delta]['select_other_text_input'])) {
-    form_set_error($field_name . '[' . $langcode . '][' . $delta . '][select_other_text_input]', t('A non-empty value is required for this option.'));
+    form_set_error($element['#name'], t('A non-empty value is required for this option.'));
   }
 
   // Non-required field value.
@@ -361,6 +361,15 @@ function cck_select_other_process($element, &$form_state) {
 function cck_select_other_pre_render($element, $form_state = NULL) {
   static $js;
 
+  $errors = form_get_errors();
+  if (!empty($errors)) {
+    // Validation errors for the text input box get lost so need to be injected.
+    $text_element = $element['#name'] . '[select_other_text_input]';
+    if (in_array($text_element, array_keys($errors))) {
+      $element['select_other_text_input']['#attributes']['class'][] = 'error';
+    }
+  }
+
   if (!isset($form_state)) {
     return $element;
   }
