Problem with errorPlacement in validator plugin jQuery

Posted by novellino on Stack Overflow See other posts from Stack Overflow or by novellino
Published on 2010-05-06T14:12:53Z Indexed on 2010/05/06 18:28 UTC
Read the original article Hit count: 368

Hello, I am using the validator plugin of jQuery. By default the error label is added below my form. I want to add it above my form. So what I am doing is adding the code below in the validate():

errorPlacement: function (error, element) { 
    error.insertBefore('form#emailForm');
 }

The problem is that the error label now is added a lot of times above the form, in every click. So I have something like this:

Enter valid email.Enter valid email.Enter valid email.

Does anyone know what's wrong with it?

Thanks in advance!

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about validator