Passing form data to an IFRAME that loads another site?

Seveni
Seveni used Ask the Experts™
on
Here's my situation.  I have a consumer product site that has its own e-commerce system.  However, the client uses Yahoo! Store for their shopping cart.  When the customer needs to view their shopping cart by clicking the 'shopping cart' link I just load up the Yahoo! Store shopping cart into an IFRAME.

Right now when a user clicks 'Add to Cart' I have a form with hidden fields that passes the necessary form data to Yahoo! to populate this shopping cart.  The problem is that I need to be able to pass that form data to the IFRAME that I display the Yahoo Store shopping cart in, otherwise the shopping cart pops up in the main browser window taking the users away from my clients site.

Any idea on how I can do this?

Best,
Seveni
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
cant you do this with the target attribute?

target=frame I display the Yahoo Store shopping cart in

Author

Commented:
The problem is the IFRAME I am hitting is in another page.  Here's a bit of a better description.

ProductPage.asp -> User clicks 'Add To Cart'
ProductPage.asp -> Pass form values to Yahoo Shopping Cart
(What happens now)
Yahoo Shopping Cart opens in full screen replacing ProductPage.asp
(What I need to happen)
ProductPage.asp -> Pass form values to ShoppingCart.asp targeting the IFRAME in ShoppingCart.asp which loads Yahoo shopping Cart.

Is this possible?
Commented:
I found this didnt try it but I know you can do it in a number of ways, this being one.



You can submit a FORM to a new window with
  <FORM TARGET="_blank" ...>
but that newly opened window has the standard dimensions and features.
If you want to set the features of the window then use the onsubmit
handler to open a window with a certain name and the desired features
first, then set the FORM's TARGET to the window name before submitting
the FORM:

<SCRIPT>
function openTarget (form, features, windowName) {
  if (!windowName)
    windowName = 'formTarget' + (new Date().getTime());
  form.target = windowName;
  open ('', windowName, features);
}
</SCRIPT>


<FORM ACTION="whatever"
      ONSUBMIT="openTarget
(this, 'width=300,height=300,resizable=1,scrollbars=1'); return true;"
>

The openTarget function needs at least two arguments, without the third
it always opens a new window (like target _blank) but you can provide a
third argument for the window name to reuse the window later.
Learn Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

Top Expert 2013

Commented:
This question has been abandoned. I will make a recommendation to the
moderators on its resolution in a week or two. I appreciate any comments
that would help me to make a recommendation.
<note>
   In the absence of responses, I may recommend DELETE unless it is clear
   to me that it has value as a PAQ.  Silence = you don't care
</note>

Cd&

Commented:
did my answer not work?
Top Expert 2013

Commented:
It is time to clean this abandoned question up.

I am putting it on a clean up list for CS.

<recommendation>
points to IQUITIT

</recommendation>

If anyone participating in the Q disagrees with the recommendation,
please leave a comment for the mods.

Cd&
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial