SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: Keyboard focus

  1. #1
    SitePoint Member
    Join Date
    Jul 2000
    Location
    Odense - Denmark
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi!

    Does anyone know how to make a text-inputfield automatically fucused, so when you enter a page you can just start typing without moving the mouse and clicking on the textfield??


  2. #2
    SitePoint Zealot
    Join Date
    Feb 2000
    Location
    MI
    Posts
    166
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">code/font><HR><pre>
    &lt;script language="JavaScript"&gt;
    &lt;!--
    document.myform.message.focus();
    // --&gt;
    &lt;/script&gt;
    [/code]

    Make sure to add the name tag to the form, and change myform to the name you specify. Also, change message to the name of the field you want to be autoselected.

    Richard
    richjb::382

    ------------------
    richard@brevig.com


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •