There is NO WAY to prevent the user from not leaving the page. That is how a browser works. IF they press Ok, they will go to wherever the page is going to. If they push cancel, they will stay on the current page.
If you need to force input, than
you SHOULD NOT use a pop up. Use a modal layer in the orgainl page. An example is
jQuery UI dialog.
Eric