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

submitting two frames from one frame

Status
Not open for further replies.

HobbyMan

Programmer
Sep 22, 2000
25
0
0
US
I have a frameset with two frames. Both the frames have
forms. What I wish to do is have the top form have one
button that submits both frames. Is that possible? And how?

I had the idea that the top window, from javascript, would
submit the bottom frame, check for the existence of a
variable in the bottom frame and on that finding submit the
top frame. I set a timer to keep checking until it is found.

I have read that to check for the existence of a variable
you simply do this:
if ( window.variablename )
alert("variable exists")
else
alert("variable does not exist")

When doing this I get the error "object is null or does
not exist" (javascript error dialog).

Does anybody have a good idea on this?
 
You reference objects in frames slightly different. Here is the method that I use.
Code:
top.framename.variable

The same applies for the forms.
Code:
top.framename.formname.submit();
will submit the form formname in the frame framename.
 
How do you submit the two frames?

If I have

top.FRAME1.forms[0].submit();
top.FRAME2.forms[0].submit();

it works fine under IE 6 but under NS 4 and Mozilla FRAME1
is the only one that gets submitted.
 
Hmm, I don't and never have written for NS4, so I'm not sure.
Try parent.frames[1].forms[0].submit();

Don't forget frames are numbered from 0 too.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top