Posting Data Between Frames

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I'm developing an application where the main page has an iframe that
contains the form. The "Submit" button is located on the main page (not
the iframe). Is it possible to get the form data from the iframe when
the "Submit" button is pressed in the main browser page?


Re: Posting Data Between Frames

Raffi wrote:

Quoted text here. Click to load it

Yes - go ask the same question on a javascript group.


Re: Posting Data Between Frames

Thanks for your suggestions. I ended up using CSS (the application only
allows access with MSIE 5+) and sidestepped the tedious cross-frame

Here's the code for anyone interested:

<style type="text/css">
<div.scroll {
height: 100px;
width: 300px;
overflow: auto;
border: 2px solid #0000ff;
background-color: #ffffff;
padding: 8px;}
<h4>Paint Supply Order Form</h4>
<form action="index.php" method="post">
<div class="scroll">
<select name="item">
<input name="quantity" type="text" />
<input name="color" type="text" />
<input name="weight" type="text" />
<input name="location" type="text" />
<input type="submit" name="submit" value="Submit">

Re: Posting Data Between Frames

All of the suggestions on this topic are silly. If I needed to pass data  
between frames I would just store that data in $_SESSION. And... now you  
better sit down for this... not only will you be able to access data in  
different frames, you can also access the same data in DIFFERENT BROWSER  
WINDOWS (concurrent).


Anyway hope that helps.


Raffi wrote:
Quoted text here. Click to load it

Re: Posting Data Between Frames

Raffi wrote:

Quoted text here. Click to load it

Yes, easy enough with Javascript.
Without Javascript, things get a lot more complicated (and I will not  
discuss them here.)

Try reposting your question in comp.lang.javascript for detailed  

The idea is:
- Add a function to the event pressing the submitbutton.
  (eg make it a button, and add onClick, or use onSubmit)
- read all the values from the form
val1 = document.forms.myinnerframeform.firstname.value;
val2 = document.forms.myinnerframeform.street.value;

Now call a function in your other frame (mainpage)

But it has nothing to do with PHP.

Erwin Moller

Site Timeline