SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: Form question

  1. #1
    SitePoint Addict
    Join Date
    Jul 2004
    Location
    Colorado, USA
    Posts
    370
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Form question

    I have a small form where the two fields are pre-filled, indicating what information needs to go in them (because of space constraints). I have seen forms where a simple click inside the field erases this information so that the visitor can put in their own, (instead of them having to highlight the text and delete it, manually), and I was wondering how that was done?

    Thank you for any assistance!
    Terri Eades - Web/Graphic Designer - www.terrieades.com

  2. #2
    Is Still Alive silver trophybronze trophy RetroNetro's Avatar
    Join Date
    Jul 2003
    Location
    Texas
    Posts
    6,883
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Hello

    Add this to the line for each input field, just change the name in red to match what you want the text to be

    Code:
     onfocus="this.value='';" onblur="if (this.value=='') {this.value='name';}"
    Hope it helps

  3. #3
    SitePoint Addict
    Join Date
    Jul 2004
    Location
    Colorado, USA
    Posts
    370
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you, although I am having a problem. Is there anyway to have the text appear right as the page is loaded? If you go to http://www.ethnics.com, where I am testing this out, you'll see that both fields are blank and it takes some clicking to get it to show up. It would be best in the visitor could see the text first and then clicking inside the field makes it disappear.

    Thank you again for your help!
    Terri Eades - Web/Graphic Designer - www.terrieades.com

  4. #4
    SitePoint Addict
    Join Date
    Jul 2004
    Location
    Colorado, USA
    Posts
    370
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I figured out how to fix this, myself! Thanks again for the great solution!
    Terri Eades - Web/Graphic Designer - www.terrieades.com


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
  •