I try to control the jquery.validate errors. I want to show them in a "span" i created for each one of them
not sure why, but my JS not working
this is my html code
<li>
<label for="name">name</label>
<span class="errmsg" for="name"></span>
<input type="text" name="name" />
</li>
<li>
<label for="age">age</label>
<span class="errmsg" for="age"></span>
<input type="text" name="age" />
</li>
this is my JS code
...
success: function(label) {
label.html(" ").addClass("checked");
},
wrapper: "div", // a wrapper around the error message
errorPlacement: function(error, element) {
element.parent().next('.errmsg').html(error);
}
});