我需要允许单击1按钮,以允许视图触发控制器保存其在会话中保存的值,然后触发指向付款网关的表格。
当我在本地运行它时,一切正常,但是一旦发布它,只要单击该按钮,它就什么都不做。
有人可以帮我指出什么问题吗?
非常感谢
<input type="submit" value="Make Payment" onclick="myFunction()"/>
<script>
function myFunction()
{
$('#cont').submit(doubleSubmit);
function doubleSubmit(e1) {
e1.preventDefault();
e1.stopPropagation();
var post_form1 = $.post($(this).action, $(this).serialize());
post_form1.done(function (result) {
// would be nice to show some feedback about the first result here
$('#paym').submit();
});
};
}
</script>
@using (Html.BeginForm("reservation_step_3", "Home", FormMethod.Post, new { id = "cont" }))
{
//code which allows controller to write to DB
}
<form name="Post" action="https://virtual.mygateglobal.com/PaymentPage.cfm" method="post" id="paym">
//code for redirect to payment gateway
</form>