Michelle,
I'm sorry. I've read and read over my replies and I don't know what planet I was on. It seems like you're getting close so I just wanted to show you how you can reference that 2nd window and do things like write content, change element values, close the window, etc.. all from the main window script.
As I mentioned before, if you want to access the 2nd window with script from the main window, you need to initialize the variable glogally, outside of a function like this.
<script Language="JavaScript">
<!--
var myWin
function blah() {
blah.. blah..
}
//-->
</script>
Then you can open the 2nd window inside of a function, but since you initialized the variable globally you can have access to it elsewhere. Like this..
<script Language="JavaScript">
<!--
var myWin
function blah() {
myWin = window.open("somepage.html"
;
}
//-->
</script>
Then, elsewhere in other functions on the main page, you can do things to the 2nd window like this.
<script Language="JavaScript">
<!--
var myWin
function blah() {
myWin = window.open("somepage.html"
;
}
function changeVal() {
myWin.document.forms[0].somefield.value = "Hello"
}
//-->
</script>
That's it in a nutshell. Now if you're trying to write content to the 2nd window or call a function from 2nd window to the first window and have the 1st window return a value back to the 2nd window, it's a little trickier.
Give me some details on exactly what you're trying to do and I can help with that.
ToddWW
