sanjuT
09-17-2003, 08:56 AM
i have a login page where a background image is loaded and the focus is set to the first textbaox:
<body background="Projects/back2.png" onLoad=setFocus()>
the function:
<!--
function setFocus()
{
document.forms[0].elements[0].focus();
document.forms[0].elements[0].select();
}
//-->
The problem i have is that sometimes it takes a while for the background image to load, and when this happens, the focus is not set to the first textbox. the cursor is only placed there after the image has loaded.
this presents some probs for the user, because they cannot type immediately (the delay is the prob).
is there a way for me to set the focus to the textbox before the image has loaded?
THANKS!
<body background="Projects/back2.png" onLoad=setFocus()>
the function:
<!--
function setFocus()
{
document.forms[0].elements[0].focus();
document.forms[0].elements[0].select();
}
//-->
The problem i have is that sometimes it takes a while for the background image to load, and when this happens, the focus is not set to the first textbox. the cursor is only placed there after the image has loaded.
this presents some probs for the user, because they cannot type immediately (the delay is the prob).
is there a way for me to set the focus to the textbox before the image has loaded?
THANKS!