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
Rule with remote validation, blocked due to security settings, but valid() still evaluates to true #1044
Comments
I don't see anything there that can be attributed to this plugin. If it works on one environment, its not the plugins fault if it doesn't work in the other. Maybe I'm missing something, but I can't tell without a reproducible example. |
Absolutely... Although the environment point wasn't really my point. I think that the valid() method should return as true only if the form is fully valid. Because the remote rules couldn't reach the server with the validation scripts on, it couldn't check the elements the rules were applied to, but the elements were still considered valid and valid() evaluated to true. I'd be happy to send you my code if that would help. |
To use my e-mail field as an example: registerEmail: { required: true, email:true, remote: "http://..."} To my mind, the element should only have been considered valid if all three rules checked out. The field was filled in - required == true. If you follow my thinking? And yet the valid() still evaluated to true. |
Okay, gotcha, that wasn't clear before. I don't have a good answer though, since its hard to express a I've logged a new issue, #1045 - that won't get addressed any time soon, since returning |
Hi,
Thanks for an awesome plugin - it's sped up validation tenfold for me and it's a joy to use!
I've noticed a possible issue.
I was working in a localhost environment and using a "remote" rule to validate a domain name and an email address field remotely. On the local environment, these rules failed due to HTTP security restrictions.
However, the problem I was having was that the form wasn't posting, at all. At first I thought this might be because the form wasn't valid, but I console.logged the valid() method, and it returned true. As such, I thought that there must have been some kind of event blocking going on that prevented the form from submitting.
But, when I published my code to a live environment to check it, the issue disappeared.
So, it seems that the "remote" method validates the form, but if there is an element that is validated remotely, that validation won't be counted in the valid() method.
The text was updated successfully, but these errors were encountered: