SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot amit290's Avatar
    Join Date
    Oct 2001
    Posts
    158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    select default text in a textbox

    Hi,

    Hope some1 can sort me out here....

    I've got a <textarea> and I want to put some default text in it.....easy enough...... but when the user clicks on the box (to put their own text) I want the default text to be highlighted.

    How can I get the text highlighted when the user clicks on the textbox area?

    thx in advance

  2. #2
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    select method

    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---

  3. #3
    SitePoint Zealot amit290's Avatar
    Join Date
    Oct 2001
    Posts
    158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Found this after posting......

    onFocus="this.select();"



    <textarea name="textfield" onFocus="this.select();">default text here</textarea>


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
  •