Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add warning message support for pending remote validations #1854

Closed
wants to merge 1 commit into from

Conversation

aek
Copy link

@aek aek commented Sep 4, 2016

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

@aek
Copy link
Author

aek commented Sep 4, 2016

Please review the errors in travis-ci checks since they are referring to stuffs available in the core itself like comments already available

@staabm staabm force-pushed the master branch 2 times, most recently from d621aab to 3861ce2 Compare September 26, 2016 14:28
@staabm
Copy link
Member

staabm commented Oct 2, 2016

Thanks for your work.

I dont agree that we should add the concept of warnings which more or less duplicates most stuff our error handling is already capable of.

The only real solution for the "remote pending problem" would be to use a promise based implementation. Thats something we could only add in a new major version because it will not be backwards compatible.

@staabm
Copy link
Member

staabm commented Feb 11, 2017

Will close for now because of inactivity. Feel free to ask further questions/provide furhter information regarding this topic here. We can re-open if required.

@staabm staabm closed this Feb 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

remote return false, but form.valid() return true(expect return false)
2 participants