Reputation: 11404
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);
},
Upvotes: 2
Views: 5473
Reputation: 3754
This may help
$(element).next().after(error);
Demo : http://jsfiddle.net/sparkup/behLgebw/
Upvotes: 6