SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Nov 1999
    Location
    Singapore
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Messages which go away once you click on the etxtbox

    Hi! I'm trying to do something like what sitepoint did on the main page. I need a textbox, with a message "Subscribe Here" in it. But when people click on it, the messages go away and you can insert your email address normally.

    I looked at sitepoints code, and got this.

    <input type=text name=email size=10 style="font-family: Verdana,Geneva,Arial; font-size: 8pt; width=85" onFocus=this.value='' value="SUBSCRIBE!">


    My code right now looks like this:

    <INPUT TYPE="TEXT" NAME="subject" VALUE="$subject" SIZE=40 MAXLENGTH=85>

    How do I do that?
    Adolescent Adulthood - Learn All ABout Flirting, Dating And Dumping.

  2. #2
    SitePoint Enthusiast
    Join Date
    Nov 1999
    Location
    Singapore
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can this be done for textareas as well?
    Adolescent Adulthood - Learn All ABout Flirting, Dating And Dumping.

  3. #3
    SitePoint Guru
    Join Date
    Sep 1999
    Location
    Singapore
    Posts
    854
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Didn't know there were any other Singaporean in this forum.

    Anyway, the key is this:

    onFocus=this.value=''

    Use this as an attribute of your text box.

    I don't know if this can be used for 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
  •