M
midnight_use_only
hi all,
quick question, how do you submit a form to a parent window from a
child popup window? i have the following and all online documentation
*suggests* that it should work but it does NOT:
// Parent window:
<script language="JavaScript">
function popup(url, name)
{
window.open(url, name, "width=800,height=600,scrollbars=yes");
return false;
}
</script>
....
<form name=form1 method=post action=something.php>
<input type=hidden name=h1 value='' >
<a href="#"
target="childWindowName" onclick="return popup('url.php','Some
name');">Pop</a>
....
</form>
// Now in the child popup window
<script language="JavaScript">
function handleSubmit(aValue)
{
var myParent = opener.document.forms.form1;
myParent.h1.value=aValue;
myParent.submit(); // ERROR: Object doesn't support this property
or method
return true;
}
</script>
<a href=# onclick="handleSubmit(2006);">Submit</a>
i have spent a few hours searching online and all the examples
indicates that this example should work but it doesn't, not in IE or
FF. in FF, nothing happen and in IE, the following error show up:
Object doesn't support this property or method
any idea? thanks!
quick question, how do you submit a form to a parent window from a
child popup window? i have the following and all online documentation
*suggests* that it should work but it does NOT:
// Parent window:
<script language="JavaScript">
function popup(url, name)
{
window.open(url, name, "width=800,height=600,scrollbars=yes");
return false;
}
</script>
....
<form name=form1 method=post action=something.php>
<input type=hidden name=h1 value='' >
<a href="#"
target="childWindowName" onclick="return popup('url.php','Some
name');">Pop</a>
....
</form>
// Now in the child popup window
<script language="JavaScript">
function handleSubmit(aValue)
{
var myParent = opener.document.forms.form1;
myParent.h1.value=aValue;
myParent.submit(); // ERROR: Object doesn't support this property
or method
return true;
}
</script>
<a href=# onclick="handleSubmit(2006);">Submit</a>
i have spent a few hours searching online and all the examples
indicates that this example should work but it doesn't, not in IE or
FF. in FF, nothing happen and in IE, the following error show up:
Object doesn't support this property or method
any idea? thanks!