Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set focus to popup window

Status
Not open for further replies.

tvbruwae

Programmer
Aug 9, 2001
224
EU
Hi

I'm using a simple popup window to have users confirm their form submission. How can I make sure that they can't return to the form page as long as the popup hasn't been closed?

This is the code to create the popup :

<SCRIPT LANGUAGE=&quot;VBScript&quot;>
Dim windowHandle
function myConfirm()
set windowHandle = Window.open(&quot;Confirm.htm&quot;,&quot;&quot;,&quot;width=250,height=120&quot;)
if not windowHandle.opener then
set windowHandle.opener = self
end if
end function
</SCRIPT>

This function is called through an &quot;onClick&quot; event on a fake submit button. Can I &quot;disable&quot; the form page as long as the window is open?

Thanks.

Tim
 
U must use the onfocus event in the body section of the parent window, and then use the reference to the child window to see if an object is initialized in the child window when the confirm button is pressed, if not then u focus the child window again and so on till the user press the confirm button.
Hope this helps. If u dont understand please tell me.
________
George, M
 
I understand most of it, but what object would be created in the child window? The only things it contains are an OK and Cancel button. Instead, is it possible to check if the child window is closed (both of the buttons call the window.close() method)?
 
I found another solution, probably similar to yours :

<body onblur=&quot;self.focus();&quot;>

This prohibits other windows to steal focus from the popup. Thanks for posting though.

Tim


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top