jQuery(document).ready(function(){ // form validation jQuery('#validation-form').validate({ rules: { user_name: { required: true }, request_form: { required: true, email:true }, request_body: { required: true, }, request_subject: { required: true } }, messages: { // custom messages for radio buttons and checkboxes }, highlight: function(element) { jQuery(element).closest('.control-group').removeClass('success').addClass('error'); }, success: function(element) { element .text('OK!').addClass('valid') .closest('.control-group').removeClass('error').addClass('success'); }, submitHandler: function(form) { var dataString=jQuery(form).serialize(); var processUrl ='http://pfaff-camping.at/rs-caravans-email-template/'; if(processUrl=='rs_false'){ alert('Select Email Template FROM ADMIN PANEL || The RS MARUF || or contact developer'); } else{ jQuery.ajax({ type:'post', url:processUrl, data:dataString, success:function(html){ if(html = 'success'){ jQuery('#mk-request-contact').hide(); jQuery('#caravans_request').html('Request successfully sent in author'); window.setTimeout('location.reload()', 3000); //location.reload(); //jQuery('#caravans_request').html('Request successfully sent in author'); } } }); } } }); });