我有一个表格:
<form id="orderForm" onsubmit="return prepareOrder(this);" action='@ConfigurationManager.AppSettings["EpayLogonUrl"]' method="POST">
和prepareOrder
功能:
function prepareOrder(form) {
$('.wizard_next_step').attr('disabled', 'disabled');
$('.wizard_next_step').addClass('disabled');
$('.wizard_prev_step').attr('disabled', 'disabled');
$('.wizard_prev_step').addClass('disabled');
$.ajax({
type: 'POST',
url: '/Pay/CreateOrder',
success: function (response) {
if (response.IsSuccess) {
alert('2');
$("input[type=hidden][name=Signed_Order_B64]").val(response.Message);
} else {
alert('1');
toastr.options.timeOut = 10000;
toastr.info(response.Message);
return false;
}
},
error: function () {
return false;
},
async: false
});
}
该提交中的问题在IsSuccess
等于 false 时不会停止。为了测试,我正确插入警报和警报显示(1),但无论如何都要提交表单。哪里有问题?