Setting the cursor on a form field

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Merlin

    Setting the cursor on a form field

    Hi there,

    I would like to set the cursor upon loading a page on a text field which has
    already been populated.

    The problem with this code:

    <script language="JavaS cript1.1" type="text/javascript">
    <!--
    document.send_m ail.message.foc us();
    -->
    </script>

    is that the cursor is on the bottom of the already included text. Has anybody an
    idea on how to set the cursor on postion one of the field?

    Thanx for any help,

    Merlin
  • Michael Winter

    #2
    Re: Setting the cursor on a form field

    On Thu, 18 Nov 2004 10:12:21 +0100, Merlin <news.groups@gm x.de> wrote:

    [snip]

    The first note: please don't use tabs to indent code. Instead, use spaces,
    preferably two.
    [color=blue]
    > <script language="JavaS cript1.1" type="text/javascript">[/color]

    At best, specifying a version using the language attribute is pointless.
    At worst, it's harmful. Furthermore, the language attribute has been
    deprecated for six years. Just use the (required) type attribute.
    [color=blue]
    > <!--[/color]

    Hiding scripts is also an obsolete practice.
    [color=blue]
    > document.send_m ail.message.foc us();[/color]

    [snip]
    [color=blue]
    > Has anybody an idea on how to set the cursor on postion one of the field?[/color]

    Not with any reliability. Anyway, can't your users use the Home key?

    Mike

    --
    Michael Winter
    Replace ".invalid" with ".uk" to reply by e-mail.

    Comment

    Working...