Hi,
I was wondering if is it possible to prevent a form in iframe submitting to it’s _parent page and force it to submit to iframe instead?
Please see my example below:
<html><body>
Content of page 1
<iframe src="http://server-b/form.html" width="450" height="500">
<p>Your browser does not support iframes.</p>
</iframe>
</body></html>
<html><body>
<form action="http://server-a/landing.cgi" target="_parent">
<input type="hidden" name="field1" value="val1" />
<input type="submit" value="Submit" />
</form>
</body></html>
At the moment when form is submitted, output of http://server-a/landing.cgi overwrites http://server-a/page1.html. What I a am looking for is some clever JavaScript to block target=“_parent” attribute somehow and force http://server-a/landing.cgi to stay in iframe.
Thanks