I have two forms on one page (one generated by one service so I can't change it). I need when I sumbit form1 then firstly I send with Ajax, second form an after send second form send first form. I try to do it this way:
$('#form1').submit(function(event) {
var this = (this);
event.preventDefault();
$.ajax({
type:"POST",
url: "/wp-admin/admin-ajax.php",
data: $('#form2').serialize(),
success:function(data){
this.unbind('submit').submit();
}
});
});
The problem is, that I can't send first form after second one. Ajax ends with success, but first form are not send.
Thanks for help