drupal add class to form-item if error on form to all forms
If you copy the theme_form_element() function out of includes/form.inc and into your theme's template.php file, re-name it to match your theme, and change the initial setting of $attributes['class'] accordingly:

  if (form_get_error($variables['element'])) {
    $attributes['class'] = array('form-item', 'da-error');
  } else {
    $attributes['class'] = array('form-item'); 
  }


...this will put a da-error class in the overall &lt;div&gt; wrapping this element.