开发者

Move validation message to a new place

开发者 https://www.devze.com 2023-03-04 04:23 出处:网络
<p class=\"section requiredtext\">some text<br /> <textarea class=\"title required\" id=\"foo\" name=\"foo\"></textarea>
<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

精彩评论

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