www.webdeveloper.com
Results 1 to 7 of 7

Thread: Help with form inputs

  1. #1
    Join Date
    Jan 2008
    Location
    Liverpool, England
    Posts
    74

    Question Help with form inputs

    Hi

    I would like to know how to have text in an input box on a form and when a user clicks it the text is deleted to make way for their text. I am using this code
    HTML Code:
     <input type="text" name="Name" />
    I would like to have “type your name here" in the input box.

    Could somebody please help?

    Thanks Gary

  2. #2
    Join Date
    Oct 2005
    Posts
    481
    This should work:

    Code:
     <input type="text" name="Name" value="Type Your Name Here" onClick="this.value=''" />

  3. #3
    Join Date
    Jan 2008
    Location
    Liverpool, England
    Posts
    74
    Thanks a lot this is what i was looking for.

  4. #4
    Join Date
    Jan 2008
    Location
    Liverpool, England
    Posts
    74

    Question

    Sorry to be a pain could you please tell me how to use this as a text area?

    Thanks
    Gary

  5. #5
    Join Date
    Oct 2005
    Posts
    481
    Code:
    <textarea name="Name" onClick="this.value=''" />Enter your name here.</textarea>

  6. #6
    Join Date
    Jan 2008
    Location
    Liverpool, England
    Posts
    74
    Thanks a lot

  7. #7
    Join Date
    Oct 2005
    Posts
    481
    You're welcome.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles