View Full Version : Checking if the new window is blocked.

09-24-2008, 09:20 PM

I have a self submitting form which opens in a new window using the following code.

<script type="text/JavaScript" language="JavaScript">

The form tag is as follows:
<form target="_blank" method="post" name="myform" id="myform" action="https://bankssecurewebsiteaddress">
The web site is made with Javascript and ASP.
Is there a way to check if the new window opened or blocked by a popup blocker with Javascript? Or possibly ASP?


Philip M
09-24-2008, 09:26 PM
var newWin = window.open(.....parameters.....);
if (newWin && newWin.top) {
// popup has opened
} else {
// popup has been blocked

Alternatively if you just need to have extra code to run if the window fails to open you can test if (!newWin || !newWin.top).

Quizmaster: In Roman Catholicism, baptism, confirmation and matrimony are three of the seven what?
Contestant: Deadly sins.