Monday, July 29, 2013

How to Post Data to an iframe

Here exemple how to post data in form to an iframe, You must only set the form's target attribute like iframe's name attribute.

<form action="iframe.php" target="my-iframe" method="post">

<label for="text">Some text:</label>
<input type="text" name="text" id="text">

<input type="submit" value="post">


<iframe name="my-iframe" src="iframe.php"></iframe>

The outer page doesn't even reload. But it might appear to at first glance since many browsers run the page-loading spinner in the tab when an iframe reloads.
Disqus Comments