jQuery Validation - greedy on your forms?
This post is more than 18 months old. Technology changes quickly, so some of this content may be out of date (but that's not always the case). Please verify any technical or programming information against the current release.
I was creating a page with two forms on it. I ran into an issue where I would fill out one form, and it would fail validation. Then, I tried to do the other form with passing fields, and it would keep invalidating the previous form on the same page.
I had been doing this:
$('form').validate();javascript
Instead, I found that I needed to loop through each form on the page and validate each single one in their own context. I replaced it with this code:
$('form').each(function() {
$(this).validate();
});javascript