F
Frank H. Shaw
how to call a java script function in a child window from the parent?
The function in the child window is setform();
Here's the script in the child:
<script id="setformscript">
function setform(){
this.document.forms[0].comments.value="Please BACKORDER for me: U.S. DIVERS
COZUMEL SEABREEZE SET";
}
</script>
And the parent:
<script language="JavaScript">
function newWindow(){
win2 = window.open("order.htm","win2");
}
function test(){
if (window.win2)
alert('mywindow exists');
else
alert('mywindow does not exist');
}
window.win2.document.GetElementById.setformscript = "setform();";
</script>
The purpose is to set a form element by remote from the parent window. The
parameter that needs to be applied is on the child window. I'm wrestling
with the text necessary to effect the call, I think...
Please let me know if you have any info to offer,
thanks,
Dan
The function in the child window is setform();
Here's the script in the child:
<script id="setformscript">
function setform(){
this.document.forms[0].comments.value="Please BACKORDER for me: U.S. DIVERS
COZUMEL SEABREEZE SET";
}
</script>
And the parent:
<script language="JavaScript">
function newWindow(){
win2 = window.open("order.htm","win2");
}
function test(){
if (window.win2)
alert('mywindow exists');
else
alert('mywindow does not exist');
}
window.win2.document.GetElementById.setformscript = "setform();";
</script>
The purpose is to set a form element by remote from the parent window. The
parameter that needs to be applied is on the child window. I'm wrestling
with the text necessary to effect the call, I think...
Please let me know if you have any info to offer,
thanks,
Dan