I'm using jquery validate and I want the error element in this format:
<div class="error-holder" data-error-message="Please correct this field"></div>
I already tried using the errorPlacement and errorElement option:
errorPlacement: function (error, element) {
error = error.attr("class", "error-holder").attr("data-error-message", error.text()).text("");
error.insertAfter(element);
},
errorElement: "div"
This produces the correct error element but when trying to submit the form (with other errors) the error element is duplicated each time.
How can I get the correct error element without the duplicates ?