I have sorted this problem out now:
I have a form validation script that I call check_all_fields, so in the form tag I have "OnSubmit='return check_all_fields();'" Check_all_fields is shown below, and if you look at the line above the return true statement you will see that I have set a timeout of one second, then a redirect to another page.
function check_all_fields() {
if (trim(document.add.docname.value) == "")
{
alert ("You need to enter a document Name");
document.add.docname.focus();
return false;
}
if (trim(document.add.docurl.value) == "")
{
alert ("You need to enter an associating document URL");
document.add.docurl.focus();
return false;
}
setTimeout("location.href='closewin.html'" , 1000)
return true;
}
NB trim is another function!
That other page is empty, only contains this code in the body tag: "onLoad = 'window.close()';"
I tried to get the timeout to close the window initially, but that didn't work, so I had to use the redirect.
I'm pretty sure there is another method - If anybody has a simpler one, please post.
Cheers