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();
}
}
(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();
}
}