Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jul 2007
    Posts
    135
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Creating example disappearing input text.

    How do you create text for a search field that disappears when a user clicks it? Like... Have the text "eg. Home Remodel", then user click the field and it disappears...

    Javascript is the only way?

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Location
    Kansas City, Kansas
    Posts
    1,518
    Thanks
    0
    Thanked 2 Times in 2 Posts
    I'd say that Javascript is the only way to go on this one. Try something like this.

    Code:
    <input value="default_value" onfocus="if (this.value == 'default_value') this.value = '';" />


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •