I have a form $('#myForm') that has two divs $('#myDiv1'), $('#myDiv2'), with two text fields in each. I would like a single errorContainer for each of the two divs.
If I call $('#myForm').validate({ ... }); I can only specify a single errorContainer, which isn't what I want.
If I call $('#myDiv1').validate({ ... }); I get an error from within jquery-validate: Uncaught TypeError: Cannot read property 'settings' of undefined. This leads me to presume that I cannot call validate on anything but a form.
Is there a way I can do what I want?
$('form').validate()is called once on DOM ready to initialize the plugin on theform. It should not be called multiple times and, as you already discovered, you cannot call it on an element.