Results 1 to 3 of 3

Thread: Make a form field have initial focus

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2002
    Location
    Singapore
    Posts
    32

    Make a form field have initial focus

    heya all,

    I have a couple of text boxes on a web page. How do I make 1 particular textbox have the initial focus? ie i can just start typing without having to click on the textbox
    C you, C me

  2. #2
    Frenzied Member axion_sa's Avatar
    Join Date
    Jan 2002
    Location
    Joburg, RSA
    Posts
    1,724
    Code:
    <SCRIPT LANGUAGE="JavaScript">
    	document.all["Textbox"].focus();
    </SCRIPT>

  3. #3
    Fanatic Member punkpie_uk's Avatar
    Join Date
    Sep 2001
    Location
    UK
    Posts
    645
    try putting it in the bodys onload event...

    Code:
    <body onload="document.getElementById('text1').focus();">
    SPREAD THE WORD!!! Are You Lee McCormick? Because I Am



    Lee M McCormick
    [email protected]

    Lee McCormick.com - Live
    Dynamically Webbed.com - In development but live

Posting Permissions

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



Click Here to Expand Forum to Full Width