PDA

View Full Version : problem to access "input=text" when there is self.focus()


umen
09-20-2002, 03:27 PM
Hello
i have page that i window.open("foo.html") from it
now in this foo.html i have <BODY onblur="self.focus()"> to keep the page
always in front until the user will fill some info in text boxes
BUT when i try to get focus with my mouse to some of the textboxes
i can't because of the self.focus() in the body onload
is there any way to over come this problem?
thanks
for the help

beetle
09-20-2002, 03:52 PM
<script>
window.onblur = function() {self.focus();}
</script>

adios
09-20-2002, 03:58 PM
window.onblur = function() {self.focus();}

is

<BODY onblur="self.focus()">

Try:

<html>
<head>
<title>untitled</title>
<script type="text/javascript" language="javascript">

var winhog = formhog = null;
onblur = function() {
winhog = setTimeout('window.focus()',100);
}

</script>
</head>
<body>
<form>
<input type="text"
onfocus="if(winhog)clearTimeout(winhog);winhog=null;
if(formhog)clearTimeout(formhog);formhog=null"
onblur="formhog=setTimeout('window.focus()',100)">
<input type="text"
onfocus="if(winhog)clearTimeout(winhog);winhog=null;
if(formhog)clearTimeout(formhog);formhog=null"
onblur="formhog=setTimeout('window.focus()',100)">
</form>
</body>
</html>