Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing data from one frame to another

Status
Not open for further replies.

sqoti

Programmer
Dec 1, 2000
50
US
Page has 3 frames. Two small frames and a large one. For example purposes lets call them A, B, and C.

A is a blank frame and has no purpose right now.

B hold links to other pages.

C is the main window and holds a form for the user to fill out and interact with the database. There is a input box at the top where the user will put an id into it.

What I would like to do is after the id has been entered and the database information populates Frame C, I want a link from frame B to carry that Id to a new page that will open up in frame C. Any ideas, is this really easy? Thanks in advance.
 
frames can grab values from other frames like so:

parent.framename.whateveryouwant

you can access form elements like this, variables, call functions,etc jared@aauser.com
 
Frame C is not the parent of frame B so this doesn't work. Basically what I need to do is harvest the id entered on frame C somehow. When the link is clicked on frame B it will have the id stored somewhere to pass it on to the database and create a new window targeted to frame C.
Is this possible?
 
I think you want something like this... The user inputs a number into a form and submits it. It writes that number to the database and then you have information from the database populate your main frame. So, when you rewrite your frame contents do this:

<script>
var userID = $x; // where $x is the ID returned from server-side
</script>

Then, in frame B, you can do something like this:

<a href=&quot;javascript:dolink('
<script>
function dolink(url)
{
eval(&quot;top.frameC.location='&quot;+url+&quot;?userID=&quot;+top.frameC.userID+&quot;'&quot;);
}
</script>

So, then frame C will end up going to the specified URL with your userID on the query string.
Sincerely,

Tom Anderson
CEO, Order amid Chaos, Inc.
 
These are some great suggestions, but for some reason they don't work in my stuff.

Screen is split into frames. Frame A, B, and C. For this example we only use frame B and frame C.

Frame B has several URLs to pull certain forms into Frame C.

Examples: Status
Compensation
Address
Personal
Each of these opens a dynamically functional Form into frame C where the user will enter a id. When the user enters the ID it goes out to the database and pulls data into the form depending on which URL is selected in Frame B.
Let's say for instance I select STATUS..the form comes up and I enter ID# 1234 and click on a select button. The form is then dynamically loaded with data from the database into the STATUS form.

What I want to do is create a totally different URL that grabs the ID# from frame C and goes out to a file and pulls data into a HTML document that is loaded into frame C.

When I use your suggestions all I get are object undefined errors. Please if you are in anyway familar with this kind of combining someone else's code with your HTML and getting the desired results, your help would be greatly appreciated.

Thanks in Advance!!!!!


 
Well, I guess you have to know JavaScript before trying to implement someone's suggestion. Go take a look at one of the many tutorials on the web to get some JavaScript basics and learn to debug your code.

Sincerely,

Tom Anderson
CEO, Order amid Chaos, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top