( function($) { 'use strict'; /*------------------------------------------------------------------------------- ajax form -------------------------------------------------------------------------------*/ if ($('.js-ajax-form').length) { $('.js-ajax-form').each(function(){ $(this).validate({ errorclass: 'error wobble-error', submithandler: function(form){ $.ajax({ type: "post", url:"mail.php", data: $(form).serialize(), success: function() { $('.col-message, .success-message').slidedown(); }, error: function(){ $('.col-message, .error-message').slidedown(); } }); } }); }); } })(jquery);