jQuery('document').ready(function($){
 var commentform=$('form[action$=wp-comments-post.php]');
 commentform.prepend('<div id="wdpajax-info" ></div>');
 var infodiv=$('#wdpajax-info');
 commentform.validate({
 submitHandler: function(form){
 //serialize and store form data in a variable
 var formdata=commentform.serialize();
 //Add a status message
 infodiv.html('<p>Processing...</p>');
 //Extract action URL from commentform
 var formurl=commentform.attr('action');
 //Post Form with data
 $.ajax({
 type: 'post',
 url: formurl,
 data: formdata,
 error: function(XMLHttpRequest, textStatus, errorThrown){
 infodiv.html('<p >You might have left one of the fields blank.</p>');
 },
 success: function(data, textStatus){
 if(data=="success")
 infodiv.html('<p >Thanks for your comment. We appreciate your response.</p>');

 else
 infodiv.html('<p >Error in processing your form.</p>');
 commentform.find('textarea[name=comment]').val('');
  commentform.find('input[name=author]').val('');
   commentform.find('input[name=url]').val('');
   commentform.find('input[name=email]').val('');
 
 }
 });
 }
 });
});
