twmoore
01-09-2004, 03:10 PM
I am trying to access a JS function from a child window created inline. I can't figure out the naming of the object or parent elements....
EXAMPLE CODE:
<HTML>
<SCRIPT LANGUAGE="JavaScript">
function dude () {
alert("Function dude");
return true;
}
function childwin () {
cwin = window.open("","cwin","height=520,width=620,left=180,top=80");
cwin.document.writeln('<head><title>CHILD WINDOW</title></head>');
cwin.document.writeln('<FORM name=childform method=POST action="/XXX/cgi-bin/post-query.cgi" onSubmit="return dude();">');
cwin.document.writeln('<INPUT TYPE="SUBMIT" VALUE="SUBMIT 2">');
cwin.document.writeln('</FORM>');
cwin.document.close();
}
</SCRIPT>
<BODY>
<FORM name=parent method=POST action="/XXX/cgi-bin/post-query.cgi" >
<INPUT TYPE="BUTTON" VALUE="BUTTON 1" onClick="childwin();">
<INPUT TYPE="SUBMIT" VALUE="SUBMIT 1">
</FORM>
</BODY>
</HTML>
EXAMPLE CODE:
<HTML>
<SCRIPT LANGUAGE="JavaScript">
function dude () {
alert("Function dude");
return true;
}
function childwin () {
cwin = window.open("","cwin","height=520,width=620,left=180,top=80");
cwin.document.writeln('<head><title>CHILD WINDOW</title></head>');
cwin.document.writeln('<FORM name=childform method=POST action="/XXX/cgi-bin/post-query.cgi" onSubmit="return dude();">');
cwin.document.writeln('<INPUT TYPE="SUBMIT" VALUE="SUBMIT 2">');
cwin.document.writeln('</FORM>');
cwin.document.close();
}
</SCRIPT>
<BODY>
<FORM name=parent method=POST action="/XXX/cgi-bin/post-query.cgi" >
<INPUT TYPE="BUTTON" VALUE="BUTTON 1" onClick="childwin();">
<INPUT TYPE="SUBMIT" VALUE="SUBMIT 1">
</FORM>
</BODY>
</HTML>