Art X wrote:
> The reason for this has do to with the nature of WebTV and will be
> directed to WebTV users with a conditional so that it will have no
> effect on PC users.
>
> I'm trying to create a function that will put focus to a form element
> (with a short delay) when the division that it is in is changed from
> hidden to visible.
>
I don't have WebTV to test this on, but here goes anyway (it works in
IE and Firefox at least

).
[...]
> if (navigator.appName.indexOf("WebTV") != -1)
> {
> setTimeout("document.getElementById(in_foc).focus( );", 50);
setTimeout wants a string as an argument. in_foc is evaluated when
setTimeout runs, but it is a local variable inside showDiv() and so
returns 'undefined' and the focus method fails (or likely is never
called since document.getElementById fails).
Use this:
setTimeout("document.getElementById('" + in_foc + "').focus();", 50);
in_foc will be evaluated when the call to setTimeout is made and its
value inserted (note the extra quotes).
[...]
--
Rob