Add warning message support for pending remote validations #1854
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Component: Core
Add warning message support for pending remote validations while keeping the field and form as invalid
Fixes #823 #1044 #1045 #1283 #1344 #1465 #1763 #1806
This tweaks will allow you to show a warning message to the user while the async response to the remote validations get resolved and it will make the valid response to be false if the async response to the remote validation is not ready yet but also it will allow to auto clear the invalid state for the field and the form once the async response is ready by using the remote validation normal flow so if the response is valid the field value is valid and the warning message get cleared automatically by jquery validation or if the response is not valid the error message defined is used instead of the warning message.
Just need to add another rule entry for the custom warning messages or the error default messages will be used instead.
I think that this is the most simply way to solve this problem without having to rewrite the plugin to make it work with deferred/promises. It's a very desirable feature to have deferred/promises support but this will solve the issues and also it could be used for dependency mismatch validations too