Jump to content

Target Iframe from a Form


Guest MrLeN

Recommended Posts

Guest MrLeN
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
Link to comment
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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.