Link to home
Start Free TrialLog in
Avatar of Dinesh Bali
Dinesh Bali

asked on

opening external url redirection in div modal

Hi,

I have a signup form in div tag today. And that is a model open at the bottom of the site.
We have full control of form in that today.
Now this form needs to be submitted to external url.
Now once user submits the form data to be posted in external url.
Once the data is successfully submitted then the external URL will redirect to thankyou page or error page which is configured.
We pass thank you page or error page full url in hidden field.

Please help me how to submit the form in div (model) and the re-direction to success page should open in the same div tag only.

I used iFrame for that. But it is not working well. Please advice.

I have form in subscribeform.html
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title></title>
</head>
<body>
    <form action="http://www.externalurl.com">
        <input id="SucccessURL" type="http://www.mysite.com/thankyou" />
        <input id="ErrorURL" type="http://www.mysite.com/erroronSubscribe" />
        First name:<br>
        <input type="text" name="firstname" value="Mickey">
        <br>
        Last name:<br>
        <input type="text" name="lastname" value="Mouse">
        <br><br>
        <input type="submit" value="Submit">
    </form>
</body>
</html>

Open in new window



<div class="modal fade" id="news-sign-up" tabindex="-1" role="dialog" aria-labelledby="myModallabel" aria-hidden="true">
    <div class="modal-dialog modal-sm">
        <div class="modal-content">
            <div class="modal-body">

                <a class="close" data-dismiss="modal" aria-hidden="true">Close</a>
                <h2>Subscribe</h2>
                <iframe width="100%" height="100%" src="http://localhost:2014/subscribeform.html"></iframe>
            </div>
            <!-- /.modal-content -->
        </div>     
        <!-- /.modal-dialog -->
    </div>
</div>
@Html.Partial("~/Views/Contact/Partial/InvalidCaptcha.cshtml")

Open in new window

Avatar of Chinmay Patel
Chinmay Patel
Flag of India image

Hi Dinesh,

If you want to redirect to another page Iframe is the right solution. Can you tell me what do you mean by IFRAME is not working. I think something else might be happening here. Are you getting any errors?

Regards,
Chinmay.
Avatar of Dinesh Bali
Dinesh Bali

ASKER

Found the reason.
The URL is not opened because of Cross site origin.
Site is restricted to open in iFrame

X-Frame-Option.

Is there any option apart from iFrame to solve this issue.

Please advise.
ASKER CERTIFIED SOLUTION
Avatar of Chinmay Patel
Chinmay Patel
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial