[Javascript] Iframe Nightmare

tonylabarbara at aol.com tonylabarbara at aol.com
Sat Aug 11 09:00:36 CDT 2007


Hi;

I have a strange problem. I have a form that works fine in my custom shopping cart because the <form> calls itself. Thus, I am able to both update the quantity of particular items the customer wishes to purchase and process the form. Now, I have a client that wants to use PayPal to process the form. So, I have to divide the form into two forms: one which will allow me to update quantity and one which will send the whole thing off to PP. I've decided to use an iframe to accomplish this, putting the updatable form in the iframe and using the parent form to submit to PP. This causes problems. First, for some reason, the hidden variables which get processed end up on both sides of the iframe and for some reason when I submit that form to PP, only those above the iframe get submitted. Well, I figured out how to get around that by using JS to send the form to a second form page where the variables grabbed from the iframe can be tossed correctly and in the correct order (above the i
 frame) in the parent form. But, in order to execute *that*, I need to be able to refresh the parent form when I click the iframe (and process the form therein). How can I do that? I have been googling and have come up with how to do something similar, namely, have the parent refresh an iframe upon submission, which is the opposite of what I need to do:

<script type="text/javascript">

function go()

{

document.main.submit();

}

function reload()

{

document.getElementById("padre").src=document.getElementById("padre").src;

} 

</script>

<body>

<form name="main" action="" method="post" target="county">

<select name="state" size=1 onClick="reload();"><option value=1>a</option><option value=1>b</option></select>

<iframe id="padre" src="Todo.htm" name="city" width="700" height="200" frameborder="1"></iframe>

TIA,

Tony

________________________________________________________________________
AOL now offers free email to everyone.  Find out more about what's free from AOL at AOL.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20070811/8dbd2133/attachment.htm>


More information about the Javascript mailing list