T
Tyrone Slothrop
Any idea of why this will not work? I have an image editor in a popup
that is opened from a form in a window containing data as well as
displaying images for the record. When the image has been saved, it
posts to the form in the opener from the popup, updating the record
with the new image.
Everything is working perfectly but the popup refuses to close.
After the image is saved to the server, this is the HTML which is
generated:
<html><head><title>Image Editor</title>
<body>
<form name="form" action="http://www.domain.com/data.php"
method="post">
<input type="Hidden" name="index" value="<?=$_REQUEST['index']?>" />
<input type="Hidden" name="edit" value="Edit" />
<div style="display:none"><input type="submit"></div>
</form>
<script type="text/javascript">
<!--
function submitform(thisForm)
{
if (!opener.closed)
{
if (opener.name) {thisForm.target=opener.name;}
else {thisForm.target = opener.name
='parentwin'+math.floor(math.random()*10000);}
}
thisForm.submit();
}
document.onload = submitform(document.form);
setTimeout('top.close()', 3000);
//-->
</script>
</body></head></html>
Any ideas?
TIA!
that is opened from a form in a window containing data as well as
displaying images for the record. When the image has been saved, it
posts to the form in the opener from the popup, updating the record
with the new image.
Everything is working perfectly but the popup refuses to close.
After the image is saved to the server, this is the HTML which is
generated:
<html><head><title>Image Editor</title>
<body>
<form name="form" action="http://www.domain.com/data.php"
method="post">
<input type="Hidden" name="index" value="<?=$_REQUEST['index']?>" />
<input type="Hidden" name="edit" value="Edit" />
<div style="display:none"><input type="submit"></div>
</form>
<script type="text/javascript">
<!--
function submitform(thisForm)
{
if (!opener.closed)
{
if (opener.name) {thisForm.target=opener.name;}
else {thisForm.target = opener.name
='parentwin'+math.floor(math.random()*10000);}
}
thisForm.submit();
}
document.onload = submitform(document.form);
setTimeout('top.close()', 3000);
//-->
</script>
</body></head></html>
Any ideas?
TIA!