template.php function for adding field CSS classes
Using yourtheme_preprocess_field() won't work for forms because theme_field() isn't called. Instead, theme_form_element() is executed, which builds the form element wrapper.
If you want to use/override the input itself override the corresponding theme function, e.g. theme_textfield() and so on.

Another way could be using hook_form_alter()/hook_FORMID_form_alter() if you want to override the attributes for a specific form only.