473,414 Members | 1,777 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

Posting Data Between Frames

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?

Thanks,
Raffi

Aug 18 '05 #1
4 1971
Raffi wrote:
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?

Thanks,
Raffi


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
description.

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;
etc.

Now call a function in your other frame (mainpage)
parent.frames.mainwindow.getThis(val1,val2);

But it has nothing to do with PHP.

Regards,
Erwin Moller
Aug 18 '05 #2
Raffi wrote:
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?

Thanks,
Raffi


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

C.
Aug 18 '05 #3
Thanks for your suggestions. I ended up using CSS (the application only
allows access with MSIE 5+) and sidestepped the tedious cross-frame
scripting.

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;}
</style>
<html><body>
<h4>Paint Supply Order Form</h4>
<form action="index.php" method="post">
<div class="scroll">
Item:
<select name="item">
<option>Paint</option>
<option>Brushes</option>
<option>Erasers</option>
</select>
<br><br>
Quantity:
<input name="quantity" type="text" />
<br><br>
Color:
<input name="color" type="text" />
<br><br>
Weight:
<input name="weight" type="text" />
<br><br>
Location:
<input name="location" type="text" />
</div>
<br><br>
<input type="submit" name="submit" value="Submit">
</form>

Aug 22 '05 #4
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).

*SHOCK HORROR*

Anyway hope that helps.

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

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;}
</style>
<html><body>
<h4>Paint Supply Order Form</h4>
<form action="index.php" method="post">
<div class="scroll">
Item:
<select name="item">
<option>Paint</option>
<option>Brushes</option>
<option>Erasers</option>
</select>
<br><br>
Quantity:
<input name="quantity" type="text" />
<br><br>
Color:
<input name="color" type="text" />
<br><br>
Weight:
<input name="weight" type="text" />
<br><br>
Location:
<input name="location" type="text" />
</div>
<br><br>
<input type="submit" name="submit" value="Submit">
</form>

Aug 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Kathryn | last post by:
I hope you can help as this is driving me crazy! I have an asp which has 3 frames on it as follows: <FRAMESET rows="50%,*,10%"> <FRAME src="rundetailstop.asp" name="rundetailstop"...
3
by: John Chen | last post by:
I need to use iframe to create a floating frame. But the contents in the iframe is not a external html file. Rather, it will be dynamically created by jsp. How can I set the src attribute to a URL...
3
by: PVU | last post by:
Hello, I have an page that calls the function below. What i want to do is that this function post data to the server (ASP) and the server will response with 'OK' My question is how can i send...
2
by: Peter | last post by:
I have a link that refers to a page that requires authentication. Is there a way to set the logon credentials prior to or while posting to a new web page.... My users are clicking on the link...
1
by: GEvans | last post by:
Hi, I have a HTML page consisting of two frames, one visible and one hidden. The hidden frame contains javascript variables holding session information. The visible frame contains interactive...
1
by: s.d | last post by:
Hi, I have a frameset and two aspx page. How can post data from one web form to other one. Thanks
3
by: Evan | last post by:
I have a web page with 2 frames. The left frame is running menu.aspx and the right frame is running images.aspx. When a selection is made in menu.aspx I call a method in images.aspx and pass a...
4
by: pbd22 | last post by:
hi. could somebody tell me, when uploading a file, i know the form where the upload component is must have enctype=multipart/form-data but, is the same true for the form with the server code to...
1
by: Ike | last post by:
I have what is perhaps a stupid problem. I have a form where users enter values (call this page1.php), and these then need to be POSTed to a page (page2.php) (code at bottom of this posting), that...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.