I am trying to make use of the errorPlacement option as follows:
$("#MyForm").validate({
rules: {
'brand': {
required: true,
errorPlacement : function(error, element){
console.log(error);
console.log(element);
error.appendTo(element.parent('div.formRight'));
error.css("clear", "both");
}
}
But for some reason the function is only receiving one parameter (the element) ... in the console logs in the error parameter there is the element reference whilst the element parameter is undefined.
Is there a specific way to reference the error element?
Thanks