UPDATE 2: I figured out that the title of the input was for some reason being displayed as an error message, I used ignoreTitle: tru
just comment the errorplacement option and it will work as required.
$(".guestlist-form").validate({
ignoreTitle: true,
errorClass: "error-class",
validClass: "valid-class",
rules: {
emailaddress: {
required: true,
email: "Please enter your correct email address."
}
},
/*errorPlacement: function(error, element) {
$(".myerror").html(''); // clears previous error messages
error.appendTo( ".myerror");
},*/
messages: {
emailaddress: {
required: "Please enter your full email address."
}
}
});
Updated fiddle - http://jsfiddle.net/psbq8vkj/11/
You have to add the success
function to the validation :
success: function(label,element) {
$(".myerror").html('');
},
JSFiddle