-
Hi All,
I have a main asp page with text boxes whose onChange event will open a new window when the text box value is > 0 (btw, new window is a frameset).
1. Can I keep the new window on top of the main window?
or
2. Can I close the new window via code in the main page if e.g. a text box value was 7 and opened a new window then was changed to 0 and I would like to close the current new window.
I have tried...
<input type="text" name="txt01" value="0" onChange='
If txt01.value > 0 then
set oWin=Window.Open("ViewPort.asp?iNod=" + txt01.value + "&sB=&iZoomP=100", "MyViewport")
else
if oWin Is Nothing Then
else
oWin.close
End If
End If '>
But I get error...
Object required: 'oWin'
and the script debugger points to the line "oWin.close"
-
Here is a code which will close the main window.
Code:
<script language="javascript">
function closeWin()
{
window.close();
};
</script>
<A HREF="javascript:closeWin();"
onMouseOver="window.status='Close the Window';return true";>Close Window</A>
-