How do I use the jquery fadeOut function to fade out the validation response message “this field is required” at this Fiddle. I just want the messages to pop up (not fade in) then fade out slowly over maybe 3 seconds.
This is the js that controls the Validation plugin:
$(document).ready(function() {
$('#commentForm').validate({
submitHandler: function(form) {
$.ajax({
type: 'POST',
url: 'process.php',
data: $(this).serialize(),
success: function(returnedData) {
$('#commentForm').append(returnedData);
}
});
return false;
},
errorPlacement: function(error, element) {
error.insertAfter( element).position({
my:'right top',
at:'right top',
of:element
});
}
});
});
Thank you for your input.
All you need to do is call fadeOut on the
errorargument inerrorPlacement():Working example: http://jsfiddle.net/kmJ87/4/