Could this possibly be because the page hasn't finished loading yet?
That often occurs on sites with agency-issued banenrs and the like.
onLoad() will only be called once the page has completely loaded. You
could as an experiment try putting the script inline after your form
instead.
..
<input name="username">
</form>
<script language="Javascript">
document.forms.login.username.focus()
</script>
"Foth, Oliver" wrote:
>
> <body onload="document.forms.login.username.focus()>
>
> When I change onLoad to onMouseOver, the focus is set as soon as I move the
> mouse.
>
> -----Ursprungliche Nachricht-----
> Von: Simon Christian [mailto:[EMAIL PROTECTED]]
> Gesendet: Donnerstag, 21. Juni 2001 22:50
> An: [EMAIL PROTECTED]
> Betreff: Re: AW: focus on an entry-field
>
> "Foth, Oliver" wrote:
> >
> > I've tried that, but as I said onLoad seems to be ignored. When I change
> > onLoad to any other event-handler it works.
> >
> > Here's my code:
> > $page.addttribute("onLoad","document.forms.login.username")
>
> I guess this depends on what your $page.addAttribute method does. What
> is the HTML that is produced in this case?
>
> - simon
--
Regards,
Simon Christian
CPD Online plc
t. 020 8446 7890
f. 020 8446 6688