Redirect <form> post 303 to another domain in bootstrap modal pop up

134 Views Asked by At

I am trying to redirect(303) from one domain to another different domain(payment gateway - EXTERNAL URL) within bootstrap modal pop up on Form POST

Below is the complete code:


<body onload="PostData()">
    <!-- start modal-->
    <div class="modal-dialog" id="popup" >
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">×</button>
                <h4 class="modal-title">Payment gateway</h4>
            </div>
            <div class="modal-body">
                <p>You are now leaving this website.</p>
<input type="submit" id="redirectForm" class="hide" onclick="PostData()" />
   <form id="form1" target="popup" method="POST" enctype="application/x-www-form-urlencoded" action="https://anotherdomain.com/payment">
    </form>
            </div>
            <div class="modal-footer text-center">
                    <button type="button" title="go back" onclick="closewindow()">Go Back</button>
            </div>
        </div>
    </div>
</body>

I would submit the form on a button click event:

When I make the POST call the user is not redirected to the payment gateway inside the modal pop up
What's the best cross domain implementation with the usage of Form POST + Bootstrap modal popup + javascript + ASP.NET MVC

I have also tried embedding Form POST inside modal-body but redirection is not happening.

0

There are 0 best solutions below