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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • AnalogKid17@gmail.com

    #1

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

    I have the following line of code in my start/login page:

    document.getEle mentById("txtLo gin").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"

  • AnalogKid17@gmail.com

    #2
    Re: JavaScript focus() function not working in "start without debugging"

    Forgot to mention... version is VS2005

    AnalogKi...@gma il.com wrote:[color=blue]
    > I have the following line of code in my start/login page:
    >
    > document.getEle mentById("txtLo gin").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"[/color]

    Comment

    • Marina Levit [MVP]

      #3
      Re: JavaScript focus() function not working in "start without debugging"

      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.

      <AnalogKid17@gm ail.com> wrote in message
      news:1150474212 .265933.290700@ i40g2000cwc.goo glegroups.com.. .[color=blue]
      >I have the following line of code in my start/login page:
      >
      > document.getEle mentById("txtLo gin").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"
      >[/color]


      Comment

      • AnalogKid17@gmail.com

        #4
        Re: JavaScript focus() function not working in &quot;start without debugging&quot;


        Marina Levit [MVP] wrote:[color=blue]
        > 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.
        >[/color]
        I see... thanks.

        Comment

        Working...