SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast storkfmny's Avatar
    Join Date
    Mar 2012
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Autoload cursor in textbox

    I have a problem with getting to have the cursor atomatically appearing in the textbox without messing up other functions going on. Is there any way to get the cursor in the textbox when the page loads without messing up the funtion or am I stuck with users having to click in the box before entering info?

  2. #2
    Mouse catcher silver trophy
    Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,822
    Mentioned
    110 Post(s)
    Tagged
    1 Thread(s)
    You can do it with this snippet of Javascript:
    <body onLoad="document.forms.formname.inputname.focus()">
    Obviously change the bits in green to the relevant names for your page.


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
  •