Jump to content

Archived

This topic is now archived and is closed to further replies.

MrLeN

Target Iframe from a Form

Recommended Posts

I need to target an Iframe that is on a new page. ie:

Page one has:

<form method="post" action="cart.pl" target="cartframe">

Page two has:

<iframe src="cart.pl" width="100%" name="cartframe"></iframe>

I can't use the action, because the action is already being used to submit information to cart.pl - However, I want that information to be displayed in n Iframe on a second page.

Any ideas?

MrLeN

Share this post


Link to post
Share on other sites
I may be mistaken, but I believe you can only specify a target that exists on the current page (or frameset, if frames are used), or a target such as _parent, _top, or _blank. What you might need to do is send the URL of the IFRAME to the second page via a form, and use a Javascript to catch and load the URL in the IFRAME when the page is loaded.

-EDIT-

Please note that you would absolutely want to validate any URL passed in such a fashion before loading it in an IFRAME. Javascript has a regex engine, that would be a good start.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.