Hello! On the local server (Denver) everything works - the message is sent. On the hosting - does not work. Sometimes the truth works. What is the reason I can not understand. http://www.szsi.com.ua/page/page1/index.html link to the site but this is the situation: first, the jQuery 1.4.3 library was used - everything worked - now no. Tried other library libraries - sometimes it works with the library 1.8.3 Explain what could be the reason.

$('document').ready(function(){ $('#form1').validate({ // правила для проверки rules:{ name1: { required: true, minlength: 2, maxlength: 30 }, email1: { required: true, email: true }, phone1: { required: true, number: true, minlength: 5, maxlength: 15 }, msg1: { required: true, minlength: 5, maxlength: 2000 } }, // выводимые сообщения при нарушении соответствующих правил messages:{ "name1":{ required: "Заполните это поле", minlength: "От 2 до 30 символов", maxlength: "От 2 до 30 символов" }, "email1":{ required:"Заполните это поле", email:"Введите корректный email адрес" }, "phone1":{ required: "Заполните это поле", number: "Только цифры", minlength: "От 5 до 15 символов", maxlength: "От 5 до 15 символов" }, "msg1":{ required: "Заполните это поле", minlength: "От 5 до 2000 символов", maxlength: "От 5 до 2000 символов" } }, // указаваем обработчик submitHandler: function(form) { $(form).ajaxSubmit({ target:'#preview1', success:function() { $('#contact_form1').slideUp("fast", function() { $(this).before("<div id='checkmark1'><img src='img/check.png'><p>Спасибо, Ваша заявка успешно принята :)</p></div>"); }) } }); } }) }); 

    2 answers 2

    try adding "async: false":

     $(form).ajaxSubmit({ target: '#preview1', async: false, success: function() { 
    • does not work - soledar10
    • Unstable job hosting. Thank you all for your help! - soledar10 1:58 pm

    In jQuery, since version 1.9, a lot has changed. Check the compatibility of the plugin (using jquery.form.js?) With the library. Or connect the latest versions of both scripts.

    • I have version 1.8.3 - this is a transitional version. The question is why it works on a local computer and it works on a host. And now it doesn’t want to work on a host - soledar10
    • You can upgrade by setting the response to success in success: function (response) {console.log (response); $ ('# contact_form1'). slideUp ("fast", function () {$ (this) .before ("<div id = 'checkmark1'> <img src = 'img / check.png'> <p> Thank you Your application has been successfully accepted:) </ p> </ div> "); }) - Kudrin Sergey
    • does not help - I think maybe the problem is in hosting - they have some kind of glitches - soledar10