Problem/Motivation

Currently it seems like our custom success handler for ajax validation doesn't properly hide pre-existing errors.
This is because we don't call validator.prepareElement(element); if the element is valid. This is to ensure the highlight / unhighlight handlers are called. However, this also means we've to register the errors to hide on our own.

Proposed resolution

Add validator.toHide = validator.errorsFor(element); before calling validator.showErrors(); that way it's similar to what would happen if we would use validator.prepareElement(element);.

Remaining tasks

Reviews needed.

User interface changes

None

API changes

None

Support from Acquia helps fund testing for Drupal Acquia logo