Error class not being set on form fields I have a complex for that for various reasons I am validating in the _submit hook instead of the _validate. This is working great with the exception that the error class isn't getting added to the form elements.

Is there something simple I am missing or do I need to use form_get_errors and set the classes myself?

(The reason I am doing validation in submit is because I want to save the form data regardless of if it is valid or not.)
The easiest thing to do, would be to save the form data in the validation step if the form has errors.

function form_validate(&amp;$form, &amp;$form_state) {
  // Validate
  if (form_get_errors()) {
    // This code is only run if the form has errors.
    // Save the form data
    db_query("...");
  }
}


Then you could raise the errors and let drupal do it's thing, and use the submit function for it's intended use: handle valid form data.

If you need to process the data this can be done in the validation step as well, as the info in the $form_state array will be carried to the form submit handler.