popup blocker

J

jimmygoogle

I am trying to get a site with a form on it to open a new window
(once) when any element of the form has focus.

The function I am using on page load causes the popup blocker to be
triggered. However, if I set the onfocus in the form element (onfocus
= loadWindow();) - everything works as it should (no popup blocker).
Anyone know how to do this without going through each form element and
putting the onfocus code in there?

function setHandlers() {

var inputs = document.getElementsByTagName("input");

for (var i = 0 ; i < inputs.length ; i++){

//blocked by popup blocker
inputs.onfocus = function(){loadWindow();}

//causes the page to try to load the window
for each form element
//inputs.onfocus = loadWindow();

}

}
 
J

jimmygoogle

jimmygoogle said the following on 10/16/2007 5:23 PM:


Bad idea.


Hmmm. User sets focus, window opens, user closes unwanted popup, input
field regains focus, window opens, repeat annoyance factor.

Bad idea again. And, that is assuming the window even opens to start with.

Rethink your design, it is fatally flawed and doomed as it is.

The window is opened underneath the current window only once thats
it. It cannot be opened more than one time. Granted it is annoying
it is what my project calls for.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top