JQuery: Specify placement of error messages inline using Metadata and Validate plugins
<p>I'm doing form validation using JQuery with the validate and metadata plugins.  I'm using the metadata plugin so I can specify the rules and messages inline in the html form instead of in the javascript in the page .  I'm getting an error when I try to specify the location of the error message using errorPlacement.  (If I specify it in the  section it works fine, but not if I specify it inline.)</p>

<p>Here's what my html looks like:</p>

<pre><code>&lt;input name="list" id="list1" type="checkbox"  
  validate="{required:true, minlength:1,   
  messages:{required:'Please select at least one newsletter.', minlength:'Please select at least one newsletter.'},  
  errorPlacement: function(error, element) { error.appendTo('#listserror');} }"&gt;
</code></pre>

<p>As reported by the validate debug function, the error is:  "<strong>error.appendTo is not a function.</strong>"  </p>

<p>It works fine if I specify it in the  section like this:</p>

<pre><code>$().ready(function() {  
  $("#subscribeForm").validate({  
  errorPlacement: function(error, element) {  
  if (element.attr("name") == "list" )  
    error.appendTo("#listserror");  
  else  
    error.insertAfter(element);  
  }
});
});
</code></pre>
