bazz
04-05-2003, 05:34 PM
I got this two part script from here - http://developer.irt.org/script/165.htm
I've inserted the first bit in one of my web pages and it seems to work. Well it opens the correct form in the new window. But where do I put the second bit of the script? In the form page or as part of the script in the original page?
What tags do I put it in too?
If one window opens another:
<script language="JavaScript"><!--
function newWindow(file,window) {
msgWindow=open(file,window,'resizable=no,width=200,height=200');
if (msgWindow.opener == null) msgWindow.opener = self;
}
//--></script>
<form>
<input type="button" value="Open New Window" onClick="newWindow('a.html','window2')">
</form>
To access the contents of a form field in new window from the original window:
var myVar = msgWindow.document.formName.formFieldName.value;
It's this last line that i dunno where to put or what tags to put it in etc.
Thanx mucho.
I've inserted the first bit in one of my web pages and it seems to work. Well it opens the correct form in the new window. But where do I put the second bit of the script? In the form page or as part of the script in the original page?
What tags do I put it in too?
If one window opens another:
<script language="JavaScript"><!--
function newWindow(file,window) {
msgWindow=open(file,window,'resizable=no,width=200,height=200');
if (msgWindow.opener == null) msgWindow.opener = self;
}
//--></script>
<form>
<input type="button" value="Open New Window" onClick="newWindow('a.html','window2')">
</form>
To access the contents of a form field in new window from the original window:
var myVar = msgWindow.document.formName.formFieldName.value;
It's this last line that i dunno where to put or what tags to put it in etc.
Thanx mucho.