Home All Groups Group Topic Archive Search About

JavaScript focus() function not working in "start without debugging"

Author
16 Jun 2006 4:10 PM
AnalogKid17
I have the following line of code in my start/login page:

document.getElementById("txtLogin").focus();

When I run the website app through F5 (Debug, Start Debugging) it works
fine (ie, focus on txtLogin). When I run with CTRL+F5 (Debug, Start
without debugging) the focus defaults to the URL box.

Can anybody unveil the mystery ?

Thanks.

Keywords: javascript focus dotnet .net debug "stOOpid problem"

Author
16 Jun 2006 4:12 PM
AnalogKid17
Forgot to mention... version is VS2005

AnalogKi***@gmail.com wrote:
Show quoteHide quote
> I have the following line of code in my start/login page:
>
> document.getElementById("txtLogin").focus();
>
> When I run the website app through F5 (Debug, Start Debugging) it works
> fine (ie, focus on txtLogin). When I run with CTRL+F5 (Debug, Start
> without debugging) the focus defaults to the URL box.
>
> Can anybody unveil the mystery ?
>
> Thanks.
>
> Keywords: javascript focus dotnet .net debug "stOOpid problem"
Author
16 Jun 2006 4:21 PM
Marina Levit [MVP]
I am guessing the debugger is interfering with focus.  In general, when
using the debugger in any type of application, all sorts of events can be
interrupted or changed just because the debugger is there.

<AnalogKi***@gmail.com> wrote in message
Show quoteHide quote
news:1150474212.265933.290700@i40g2000cwc.googlegroups.com...
>I have the following line of code in my start/login page:
>
> document.getElementById("txtLogin").focus();
>
> When I run the website app through F5 (Debug, Start Debugging) it works
> fine (ie, focus on txtLogin). When I run with CTRL+F5 (Debug, Start
> without debugging) the focus defaults to the URL box.
>
> Can anybody unveil the mystery ?
>
> Thanks.
>
> Keywords: javascript focus dotnet .net debug "stOOpid problem"
>
Author
19 Jun 2006 5:34 PM
AnalogKid17
Marina Levit [MVP] wrote:
> I am guessing the debugger is interfering with focus.  In general, when
> using the debugger in any type of application, all sorts of events can be
> interrupted or changed just because the debugger is there.
>
I see... thanks.