How to send form from inside iframe and get result outside

I am trying to have a small login widget that I embed in a static page inside an iframe so that someone visits my site. The problem I get is that when form posts end, they appear inside the iframe, and not like a full browser page.

I know that this can be done because https://www.salliemae.com/ uses the same strategy on its homepage. They will embed an iframe inside their static page, which does all their logic for them. I have a very similar javascript in which I call form.submit () when someone clicks. The only difference is that I use jQuery to catch the click vs event by placing onclick directly on the form element.

I looked at their code in their quiet.js and it seems to make a simple .submit () form, just like me, but their page is fully loaded in the browser and only in the iframe. I looked around and did not see such a message, so if I just missed it, let me know.

+7
source share
2 answers

See target="_top" in the iframe <form> . This tells the browser to load the response in the parent frame.

+15
source

If you do not use ajax for content, you simply add target = "_ top" to the form, otherwise you will have to use window.open (serializedurl, "_ top")

+1
source

All Articles