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

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top