cursor placement

Discussion in 'HTML' started by DMc, Sep 17, 2003.

  1. DMc

    DMc Guest

    When I open up my login page, I would like the cursor to be in the username
    box. How would I achieve this?

    Tia,
    DMc.
    DMc, Sep 17, 2003
    #1
    1. Advertising

  2. DMc

    Mark Parnell Guest

    DMc wrote:
    > When I open up my login page, I would like the cursor to be in the
    > username box. How would I achieve this?
    >


    It *can* be done with Javascript, but isn't recommended (for reasons that
    others are probably better placed to explain than me ;-) ).

    --

    Mark Parnell
    http://www.clarkecomputers.com.au
    Mark Parnell, Sep 17, 2003
    #2
    1. Advertising

  3. DMc

    rf Guest

    "Mark Parnell" <> wrote in message
    news:3f67a694$0$23592$...
    > DMc wrote:
    > > When I open up my login page, I would like the cursor to be in the
    > > username box. How would I achieve this?
    > >

    >
    > It *can* be done with Javascript, but isn't recommended (for reasons that
    > others are probably better placed to explain than me ;-) ).


    A quick user or one on a slow connection may, before the page finishes
    loading, tab to the username box, fill it in and then proceed to the
    password box and start typing. The page finishes loading at this point and
    user doesn't notice that she is now typing in the username box again.
    Frustrating.

    Cheers
    Richard.
    rf, Sep 17, 2003
    #3
  4. DMc

    andy johnson Guest

    On Tue, 16 Sep 2003 19:58:37 -0400, "DMc" <> wrote:

    >When I open up my login page, I would like the cursor to be in the username
    >box. How would I achieve this?
    >
    >Tia,
    >DMc.
    >
    >

    I used "setting form focus" in Google and came up with this:

    <html>
    <body onload="document.myForm.field1.focus()">
    <form name="myForm">
    <input type="text" name="field1">
    <Input type="text" name="field2">
    </form>
    </body>
    </html>


    -
    Andy

    "There would be a lot more civility in this world if people
    didn't take that as an invitation to walk all over you"
    - (Calvin and Hobbes)
    andy johnson, Sep 17, 2003
    #4
  5. andy johnson wrote:

    > I used "setting form focus" in Google and came up with this:


    Why search on Google? Why not just look at Google's front page?

    One thing to be aware of is that setting focus to a text field breaks the
    user's keyboard shortcuts. They can't, for example, press the down button
    to scroll down the page.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me - http://www.goddamn.co.uk/tobyink/?id=132
    Toby A Inkster, Sep 17, 2003
    #5
  6. DMc

    Nico Schuyt Guest

    DMc wrote:
    > When I open up my login page, I would like the cursor to be in the
    > username box. How would I achieve this?


    <form method="POST" name="login" action="login_test.php">
    <p><input type="text" name="password" size="7">
    ...............
    </form>

    <SCRIPT TYPE="text/javascript">
    <!--
    document.login.password.focus();
    //-->
    </SCRIPT>
    Nico Schuyt, Sep 17, 2003
    #6
  7. DMc

    andy johnson Guest

    On Wed, 17 Sep 2003 07:21:52 +0100, Toby A Inkster
    <> wrote:

    >andy johnson wrote:
    >
    >> I used "setting form focus" in Google and came up with this:

    >
    >Why search on Google? Why not just look at Google's front page?
    >
    >One thing to be aware of is that setting focus to a text field breaks the
    >user's keyboard shortcuts. They can't, for example, press the down button
    >to scroll down the page.



    You are right again. OTOH, I like the convenience of not having an
    extra mouse move with this stinking eraser head mouse on this old
    Thinkpad. If the form is a dreaded popup or a simple page the short
    cuts probably shouldn't come into play.
    -
    Andy

    "There would be a lot more civility in this world if people
    didn't take that as an invitation to walk all over you"
    - (Calvin and Hobbes)
    andy johnson, Sep 17, 2003
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jack Stone
    Replies:
    1
    Views:
    1,226
    Symon
    Jul 25, 2003
  2. Jenny

    Popup placement

    Jenny, Aug 11, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    415
    Vidar Petursson
    Aug 15, 2003
  3. =?Utf-8?B?VG9tYXMgS2VwaWM=?=

    Changing DEFAULT cursor to WAIT cursor in ASP

    =?Utf-8?B?VG9tYXMgS2VwaWM=?=, Apr 5, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    2,294
    Bruce Barker
    Apr 5, 2005
  4. invy
    Replies:
    4
    Views:
    380
    CBFalconer
    Dec 28, 2006
  5. dmaziuk
    Replies:
    3
    Views:
    555
    Chris Gonnerman
    Jan 25, 2011
Loading...

Share This Page