I think maybe you want element.is("textarea") (no colon)
Otherwise that part of the conditional will never fire.
-- Josh
----- Original Message -----
From: "shapper" <
mdmoura@gmail.com>
To: "jQuery (English)" <
jquery-en@googlegroups.com>
Sent: Tuesday, June 24, 2008 4:23 PM
Subject: [jQuery] Re: [validate] Validation Plugin issue when using TinyMCE
You mean the { after the else? Yes, I noticed that before.
I keep having the same problem. The form is not validated when I use
errorPlacement.
I am using:
$("#New").validate({
errorClass: "Error",
errorElement: "label",
errorPlacement: function(error, element) {
if (element.is(":textarea"))
error.insertAfter(element.next());
else
error.insertAfter(element);
},
rules: {
Answer: {required: true},
Question: {required: true}
},
messages: {
Answer: {required: "Insert an answer"},
Question: {required: "Insert a question"}
}
});
Any idea?
Thanks,
Miguel