Php Ajax成功后提交表单

Php Ajax成功后提交表单,php,jquery,html,ajax,Php,Jquery,Html,Ajax,我对Ajax没有什么经验,需要一些帮助。我有一个Ajax函数(见下文),我想知道在Ajax调用成功后是否可以提交HTML表单。我还包括了启动函数的按钮 <div class="buttons"> <div class="pull-right"> <input type="button" value="<?php echo $button_confirm; ?>" id="button-confirm" class="btn btn-primary" /&

我对Ajax没有什么经验,需要一些帮助。我有一个Ajax函数(见下文),我想知道在Ajax调用成功后是否可以提交HTML表单。我还包括了启动函数的按钮

<div class="buttons">
<div class="pull-right">
<input type="button" value="<?php echo $button_confirm; ?>" id="button-confirm" class="btn btn-primary" />
</div>
</div>


<script type="text/javascript">
$('#button-confirm').on('click', function() {
    $.ajax({
        type: 'get',
        url: 'index.php?route=payment/cheque/confirm',
        cache: false,
        beforeSend: function() {
            $('#button-confirm').button('loading');
        },
        complete: function() {
            $('#button-confirm').button('reset');
        },
        success: function() {
            location = '<?php echo $continue; ?>';
        }
    });
});
</script>


您希望表单将数据提交到服务器还是希望它重定向?表单重定向到外部站点并将值提交到该站点。我将收集一个样品,你没有理由提交它。您已经提出了ajax请求。完成后,只需继续执行您需要执行的操作,或者执行以下操作:success:function(){location='';},它将保持在页面上。那个种想法呢?$button_确认和$continue从哪里来?
<form name="purchase_form" method="post" action="https://www3.eigendev.com/mirapay/secure_credit.php">

<input type="hidden" name="MTID" value="<?= $mtid ?>">
<input type="hidden" name="Merchant_ID" value="f5b23eea8cf2e5db3af9845f44e1aacd">
<input type="hidden" name="MKEY" value="<?= $mKey ?>">
<input type="hidden" name="SuccessURL" value="">
<input type="hidden" name="FailURL" value="">
<input type="hidden" name="EMail" value="">
 <input type="hidden" name="Amount1" value="<?= $total ?>">

</form>