Last active
September 25, 2018 21:32
-
-
Save alexermakov/2cc012ef2edf88a5ff15 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() { | |
$('.js_form_mail').submit(function( event ) { | |
if ($(this)[0].checkValidity()) { | |
formx = $(this).serialize(); | |
formxa = $(this).serializeArray(); | |
$.ajax({ | |
type: "POST", | |
url: themePath+"/obr.php", | |
data: formx, | |
success: function(msg) { | |
write_admin(formxa); | |
$.fancybox.close(); | |
$.fancybox.open({src : '#modal_success'}) | |
} | |
}); | |
} | |
}); | |
function write_admin(fordata){ | |
fordata.push({name: 'action', value: 'order_do'}); | |
$.ajax({ | |
url: '/wp-admin/admin-ajax.php', | |
data: fordata, | |
type: 'POST', | |
success: function(data) {} | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment