Leonardo, today you're my man! It finally worked!
THAT was what I was looking for. I can't tell you how long I've been trying to achieve just that result, so you can't imagine how much I appreciate your help. Really, thanks! I actaully had found a workaround to place the error mesage with just CSS, but this is the solution I was looking for. Again, thanks man! Cheers to you. ;-) (In caso sei italiano, visto che ti chiami Leonardo, grazie mille!). Leonardo K wrote: > > 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. >> >> > > -- View this message in context: http://old.nabble.com/Validation-Plugin%3Aneed-help-with-errorPlacement-tp26719238s27240p26795821.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.