Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment | File | Size | Author |
---|---|---|---|
clientside_validation-ajax-handler-doesnt-remove-errors.patch | 611 bytes | das-peter | |