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

Dinesh BaliAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Chinmay PatelChief Technical NinjaCommented:
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.
0
Dinesh BaliAuthor Commented:
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.
0
Chinmay PatelChief Technical NinjaCommented:
Hi Dinesh,

Is it possible for you to make changes or ask someone to make changes for you to allow CORS ?
Refer to: https://enable-cors.org/server_aspnet.html

Regards,
Chinmay.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
css3

From novice to tech pro — start learning today.