Jerry,
Many thanks. I was using JavaScript Bible by Danny Goodman and it lists on
the bottom of page 66 document.formname.fieldname.onfocus();
as the proper way to give a field focus. Thank you for correcting me.
You are correct that I could do it in the onLoad but there are sometimes
more than one thing so I actually use and init() in the onLoad that would
call the setFocus method.
Thanks Again,
Mica Cooper
"Jerry Park" <No*****@No.Spam> wrote in message
news:Sm****************@bignews2.bellsouth.net...
Mica Cooper wrote: Trying to set the focus to an element of input type on loading the page.
This is the code I used but it doesn't work. Any suggestions? (IE 6,
Windows)
<SCRIPT language=JavaScript>
funcion setFocus() {
document.formname.fieldname.onfocus();
}
</SCRIPT>
<BODY onload="setFocus()">
Thanks,
Mica
Well, the setFocus() routine should say
document.formname.fieldname.focus(), but why not just say that in the
onload statement?