Move validation message to a new place
<p class="section requiredtext">some text<br />
<textarea class="title required" id="foo" name="foo"></textarea>
</p>
How do i get jquery validate to show the "required field" error message on the same line as the "some text开发者_运维百科" title. I tried a few things, but I cant get it right. Thanks a lot.
$('form').validate({
errorPlacement: function(error, element) {
error.prependTo(element.parent());
}
});
精彩评论