So I have this:
<input name="fname" id="fname" data-message-name="First Name" />
I'm running .validate() on this form and I have all the error placements correct, but I want ALL the messages (being dynamic.. not having to type them statically) to show the attribute data-message-name in the error message instead of saying 'this'.
Right now, I have this:
$('.validate-form').validate({
wrapper: "li",
errorPlacement: function(error, element) {
error.appendTo( $(element.parents('form').attr('data-error-container')) );
}
});
It spits out this error:
This field is required.
I want it to say:
First Name field is required.
I looked over the documentation and I can't seem to find where it goes into detail for this. I'm using this plugin to be exact: http://jqueryvalidation.org/documentation/
Thanks for any help.