Hi All

I have a problem which has surfaced in IE8 and Firefox. I have a browser based application with some JavaScript and server objects controlled by ASP. The application ran fine in IE6 and IE7, we now want to move to IE8 and Firefox, other browsers will (unfortunately, and not my decision) be blocked.

I have used a technique where I submit a form for validation by the database, on return I may want to open a new window or refresh and pass the focus to an existing window. It would appear that in IE8 and Firefox if the window I want to pass the focus to is already open the focus will not be fully passed to it, but the window's position on the task bar will flash. Oddly, this will not happen if the windows are being opened on the machine that hosts the application, making it harder to debug!

Code follows, any suggestions would be most welcome. I don't think the contents of the window being opened (testfocus4.asp) are significant.

FG

Copy this code into a file called testfocus5.asp

<%
fFunction = request.form("frmFunction")
%>

<html>
<head>
<script LANGUAGE="JavaScript">

var wF2

function fTestFocus(){
document.f.frmFunction.value = "Test1"
document.f.submit();
}

function fTestFocus2(){
document.f.frmFunction.value = "Test2"
document.f.submit();
}


fFunction = "<% =fFunction %>";

function init(){
document.f.test1.value = fFunction;
if (fFunction == "Test1") {
var wTF4 = window.open("TestFocus4.asp","TestFocus4","");
wTF4.focus();
}
else {
var wTF4 = window.open("","TestFocus4","");
wTF4.focus();
}
}

window.onload=init;

</script>

</head>
<body>
<form name="f" action="TestFocus5.asp" method="post">
<input type="hidden" name="frmEdit">
<input type="hidden" name="frmFunction">
<input type="text" name="test1" value="0">
<input type="text" name="fFunction" value="<% =fFunction %>">

<p>
<input type="button" value="Test1" name="TestButton1" OnClick="fTestFocus()">&nbsp;&nbsp;&nbsp;&nbsp;
<input type="button" value="Test2" name="TestButton2" OnClick="fTestFocus2()">&nbsp;&nbsp;&nbsp;&nbsp;
</p>
</form>
</body>
</html>