Results 1 to 3 of 3

Thread: Keep new window on top or Close from main page

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2000
    Location
    Florida
    Posts
    45

    Question

    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"
    If I could only remember my name...

  2. #2
    Guest
    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>

  3. #3

    Thread Starter
    Member
    Join Date
    Aug 2000
    Location
    Florida
    Posts
    45
    Thanks Matthew.
    If I could only remember my name...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width