芝麻web文件管理V1.00
编辑当前文件:/home/royashxg/bit-alphas-ltd.com/assets/front/js/contact.js
(function ($) { "use strict"; jQuery(document).ready(function ($) { $(document).on('submit', '#contact_form_submit', function (e) { e.preventDefault(); var name = $('#name').val(); var email = $('#email').val(); var subject = $('#subject').val(); var phone = $('#phone').val(); var message = $('#message').val(); if (name && email && message) { $.ajax({ type: "POST", url: 'contact.php', data: { 'name': name, 'email': email, 'subject': subject, 'phone': phone, 'message': message, }, success: function (data) { $('#contact_form_submit').children('.email-success').remove(); $('#contact_form_submit').prepend('
' + data + '
'); $('#name').val(''); $('#email').val(''); $('#subject').val(''); $('#message').val(''); $('#phone').val(''); // $('#map').height('576px'); $('.email-success').fadeOut(3000); }, error: function (res) { } }); } else { $('#contact_form_submit').children('.email-success').remove(); $('#contact_form_submit').prepend('
All Fields are Required.
'); // $('#map').height('576px'); $('.email-success').fadeOut(3000); } }); }) }(jQuery));