开发者

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());
    }
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜