[thelist] js problem

Tom Dell'Aringa pixelmech at yahoo.com
Fri Sep 13 15:53:01 CDT 2002


--- Fernando_Gómez <fgomez at criba.edu.ar> wrote:
> From: "Tom Dell'Aringa" <pixelmech at yahoo.com>
> Sent: Friday, September 13, 2002 5:32 PM
> Subject: [thelist] js problem
>
>
> > var focusField = document.getElementById("lastname");
> > (i've tried it with or without the var)
> >
> > The global script (for all pages) has this function:
> >
> > function defaultFocus()
> > {
> > focusField.focus();
> > }
>
> May be the variable has not been defined yet when defaultFocus() is
> executed? What if you try:
>
> function defaultFocus()
> {
>   if (focusField) focusField.focus();
> }

That's exactly the problem..the variable doesn't seem to be defined
yet. I am calling the defaultFocus using onLoad. The page should be
loaded, therefore the variable should be set, but it isn't. I can't
figure out why...

Tom

=====
var me = tom.pixelmech.webDeveloper();

http://www.pixelmech.com/
http://www.maccaws.com/
[Making A Commercial Case for Adopting Web Standards]

__________________________________________________
Yahoo! - We Remember
9-11: A tribute to the more than 3,000 lives lost
http://dir.remember.yahoo.com/tribute



More information about the thelist mailing list