[validate plugin] How to show a specific DIV on error?

[validate plugin] How to show a specific DIV on error?

Hi all,

Please see this code:

<form id="myform">
<input id="field1" type="text" class="required" />
<div id="field1error">Error1</div>
<input id="field2" type="text" class="required" />
<div id="field2error">Error2</div>
</form>


The above is a simplified version of my code, but it shows enough. The two DIVs are set to "display:none".

How do I invoke the validate plugin in such a way that it shows the appropriate DIV when validation fails on the relevant field?

There doesn't need to be any dynamic processing going on - the syntax for a straight "if ABC field errors, show XYZ div" would be perfect.

I have been pulling my hair out over this, and the fact that this is my first serious foray into jQuery territory doesn't help.

Any assistance appreciated.

Thanks.