Reputation: 22260
On jquery's validate plugin, an error message only disappears after the user has made focus on another element. I want to make it disappear as soon as the right info is written. How can validation be triggered 'onchange'?
Upvotes: 4
Views: 17057
Reputation: 1
I came across this while looking into a similar problem. I believe the accepted answer is a little misleading. The validate()
method is for initializing and setting up validation behavior, whereas the valid()
method will actually run the validation check. So, in order to run a validation check on change, I ended up using something like this:
$(function() {
$("#elementId").on("change", function() {
$(this).valid();
});
});
Upvotes: 0