Adding error class to Webform fields
You could use a preprocess functions in your theme for this. You can add preprocess in your template.php.

function mytheme_preprocess_textfield(&amp;$vars) { // OR preprocess_field.

  $vars['#attributes']['class'][] = 'test' ;
}


Check the $vars parameter for values that may help you determine the logic. For examples, just search your code base for preprocess_textfield or preprocess_field. For more inf