Every input element is wrapped in a div with class 'rowElem'? So your errorPlacement should be something like this:
errorPlacement: function(error, element) { $(element).closest('.rowElem').after(error); //the method closest get the closest parent with class rowElem }, On Mon, Dec 14, 2009 at 20:06, Gian-ava <b...@stylozero.com> wrote: > > Leonardo, > > I see. Firebug' error console says: > > Error: missing ) after argument list > Line: 8, Column: 12 > Source Code: > } > > Strange, since I don't think this is correct. > > Also, it says: > Error: syntax error > Line: 7, Column: 30 > Source Code: > errorPlacement: function(error, element) { > > Again, I don't see any error there. > > Anyway, if I write this, the error label gets printed after the .roxElem, > but for each required field I get as many error labels as I defined (ex: I > got 4 required fields, so for rowElem I get the 4 messages): > > $$(document).ready(function(){ > $('#actionform').validate({ > > errorPlacement: function(error, element) { > error.insertAfter(".rowElem"); > }, > > submitHandler: function(form) { > > $(form).ajaxSubmit({ > > success: function() { > $('#actionform').hide(); > $('#content').append("<p class='thanks'>Thanks! Your > request has been sent.</p>") > } > }); > } > > }); > }); > > I can't believe it is so difficult to control where to display the error > message. The problem is that since I use jqtransform plugin, the latter > prints and wraps all fields into a lot of stuff fot styling elements, and > when the validation plugin prints the error label after the input field, it > actually display IN the field. I want it out of the field, so I need it to > be printed after the .rowElem. > > Where's the plugin author? > -- > View this message in context: > http://old.nabble.com/Validation-Plugin%3Aneed-help-with-errorPlacement-tp26719238s27240p26780208.html > Sent from the jQuery General Discussion mailing list archive at Nabble.com. > >