开发者

How to place jQuery Validate error message after the label?

开发者 https://www.devze.com 2023-03-10 19:55 出处:网络
I am using jQuery Validate and need to place the error message AFTER the label element. Currently, it\'s just inserting it after the input and before the element.

I am using jQuery Validate and need to place the error message AFTER the label element. Currently, it's just inserting it after the input and before the element.

Can someone tell me how do this?

<td>
    <input type="text" id="name" name="name" class="text">
    <label for="name">Name</label>
</td>

errorElement: "div",
errorPlacement: function(error, element) {
   开发者_如何学编程 $(element).after(error);
},


This may help

$(element).next().after(error);

Demo : http://jsfiddle.net/sparkup/behLgebw/

0

精彩评论

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