I need to remove the error class from field after form submit. How to do that?
I found the function called _form_set_class but I suppose I can't overwrite it.
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.
Sign up to join this community_form_set_class()
is called from a bunch of different theme functions, including
(the rest are here)
You can override whichever of those functions you need to in your theme by renaming the function as (e.g.)
function MYTHEME_checkbox($vars) {
Then copy in the original code from the function, remove the call to _form_get_class()
, and replace it with whatever makes sense for your use case.