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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Submit a form to multiple frames in a frameset 1

Status
Not open for further replies.

GraciePoo

Technical User
Mar 16, 2001
15
US
I have a frameset set up. There is a top frame called "menu" across the top and three frames lined up next to each other below that frame. Respectively, their names are "left", "middle" and "right". The user submits a form in the top frame. I want to be able to submit the form so that the variables are passed to frames "left", "middle", and "right". I know this probably involves javascript but I have no idea how to use it. Any help would be appreciated.
 
Hey Gracie,

You should be able to do it with something like this.

function submitAllThree()
{
self.parent.left.location.href='action.cfm?var1=' + self.form1.var1.value;
self.parent.middle.location.href='action.cfm?var1=' + self.form1.var1.value;
self.parent.right.location.href='action.cfm?var1=' + self.form1.var1.value;
}

As I see it, you'll need to use url variables to do this but I think it will work. Just invoke the function in your onsubmit() handler for your form. I didn't test it so you may have to tweak it a bit.

Hope this helps,
GJ
 
Avoid Javascript if you can. This is actually very easy to do with CF.

Think. The frameset page is always hit, right? Then it calls in other pages as dictated by the frames, via FRAME SRC=.

In SRC, its just a URL screen, and you can pass parameters through it... like:

FRAME SRC="whatever.cfm?myvariable=1"

If you need to param the "myvariale" you can do so at the top of the frame page.

Example...

So, your frame page is frame.cfm. Your paes are left.cfm, right.cfm and middle.cfm. On the middle, you want to throw a variable out across the whole template. Here it is how ya do it...

middle.cfm
Code:
<A HREF=&quot;frame.cfm?variable=2&quot; TARGET=&quot;_top&quot;>


frame.cfm

Code:
<cfparam name=&quot;variable&quot; default=&quot;0&quot;>

<cfoutput>
<frame>
  <frame src=&quot;left.cfm?variable=#variable#&quot;>
  <frame src=&quot;middle.cfm?variable=#variable#&quot;>
  <frame src=&quot;right.cfm?variable=#variable#&quot;>
</frame>
</cfoutput>

Hope that helps,

DrLoGicO
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top