Akash
Akash

Reputation: 5012

Using Iframe as a parent window

I have a Iframe with loads a form within it. When I click on the submit button (in the form within Iframe), I wish to load the response within the parent window (making the iframe as the parent window)

Any ideas on how to go with it

Upvotes: 0

Views: 244

Answers (2)

basarat
basarat

Reputation: 276171

You can get access to the the parent window via "parent" property. And call functions from there if you need to do some special scripting. Otherwise I much prefer @epascarello's solution.

Upvotes: 0

epascarello
epascarello

Reputation: 207491

Set the form's target to _top.

<form target="_top" action="#" method="get">

The form submission will replace the iframe's parent.

Upvotes: 2

Related Questions