Файловый менеджер - Редактировать - /var/www/aes/assets/js/consultation.form.js
Назад
/** * * ----------------------------------------------------------------------------- * * Template : Clenia - Cleaning Services HTML Template * Author : devsdesign * Author URI : http://www.devsdesign.com/ * * ----------------------------------------------------------------------------- * **/ (function($) { 'use strict'; // Get the form. var form = $('#consultation-form'); // Get the messages div. var formMessages = $('#consultation-messages'); // Set up an event listener for the contact form. $(form).submit(function(e) { // Stop the browser from submitting the form. e.preventDefault(); // Serialize the form data. var formData = $(form).serialize(); // Submit the form using AJAX. $.ajax({ type: 'POST', url: $(form).attr('action'), data: formData }) .done(function(response) { // Make sure that the formMessages div has the 'success' class. $(formMessages).removeClass('error'); $(formMessages).addClass('success'); // Set the message text. $(formMessages).text(response); // Clear the form. $('#consultation_name, #consultation_email, #consultation_phone, #consultation_website, #consultation_message').val(''); }) .fail(function(data) { // Make sure that the formMessages div has the 'error' class. $(formMessages).removeClass('success'); $(formMessages).addClass('error'); // Set the message text. if (data.responseText !== '') { $(formMessages).text(data.responseText); } else { $(formMessages).text('Oops! An error occured and your message could not be sent.'); } }); }); })(jQuery);
| ver. 1.4 |
Github
|
.
| PHP 7.0.33-0ubuntu0.16.04.16 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка