Jump to content


Photo

Target Iframe from a Form


  • Please log in to reply
1 reply to this topic

#1 MrLeN

MrLeN
  • Members
  • PipPipPip
  • Advanced Member
  • 112 posts

Posted 04 April 2006 - 05:35 PM

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

#2 Vorotaev

Vorotaev
  • Members
  • PipPip
  • Member
  • 27 posts
  • LocationCanada

Posted 07 April 2006 - 01:20 AM

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users