SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Jul 2001
    Location
    Grosse Pointe Farms, MI
    Posts
    129
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    highlighting default value in a text box

    Ok, at http://www.sitepointforums.com/showt...threadid=61061 I hashed out a method for giving a certain txt box focus by default.

    Now I need to have the text in the box highlighted by default too.

    Any have ideas?
    Ryan
    Michigan looks like your left hand . . . half way between your wrist and the base of your thumb is where I live.

  2. #2
    SitePoint Addict
    Join Date
    May 2000
    Posts
    313
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It would have been better to keep this in your other post. You would use the select() method along with the focus() method to "Highlight" the text in a text box.
    document.formname.elementname.focus();
    document.formname.elementname.select();


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
  •