Thanks Robert
Your attachments seem not to have come through....but your comment about preemting the iframe loading was spot on.
I have solved the issue and greatly appreciate your advice.
Cheers
Aaron
----- Original Message -----
From: Robert Carpenter
To: Stafford
Sent: Sunday, November 18, 2001 6:07 PM
Subject: Re: iframe help
Aaron-
I created, tested and attached two .html files. one of them is the main window, and the other is the iframe window. save them both to the same directory and open the one named 'tester.html' you should get two alerts.
I think your problem might be in the fact that you wern't waiting until the iframe loaded.
Hope this helps,
Robert
----- Original Message -----
From: Stafford
To: eclipse_web@hotmail.com
Sent: Saturday, November 17, 2001 11:23 PM
Subject: iframe help
Robert
Thanks for your reply to my post regarding the iframe and passing variables to and from.
I have just one question:
When you mentioned the parent to iframe relationship, you said simply to for example, <iframe name>.bit>=9;
This doesn't seem to work as advertised. Included is a snippet of my code and the error message I am getting when passing variables to the iframe or calling functions from the parent.
(By the way you advice on calling parent variables and function with the parent.xxxx worked a treat)
login.html
-------------------------------------------------
<SCRIPT language=JavaScript>
<!--
var foo; //THIS WORKS
function bar() { //THIS WORKS
alert(foo);
}
anIframe.bit=9; //ERROR MESSAGE AT THIS POINT
anIframe.meit(); //NEVER CALLS
//-->
</SCRIPT>
....
<iframe ALIGN=CENTER FRAMEBORDER=0 NAME="anIframe" SCROLLING=NO SRC="incLogin.html"></iframe>
....
-------------------------------------------------
incLogin.html
-------------------------------------------------
<SCRIPT language=JavaScript>
<!--
parent.foo=5; //THIS WORKS
parent.bar(); //THIS WORKS
var bit;
function meit() { //NEVER GETS CALLED
alert(bit);
}
//-->
</SCRIPT>
....
-------------------------------------------------
The error message is:
'anIframe' is undefined
My ultimate goal hear is to have functions in the parent parsing the url and gathering cookie info and passing these values to hidden form fields in the iframe which will have three forms.
Can you clarify how I might actually set a hidden form field value of form within the iframe from the parent?
Thank you very much for you help so far.
I hope you can shed some light on this one.
Regards Aaron