www.webdeveloper.com
Results 1 to 3 of 3

Thread: [RESOLVED] Put text in an input box the disapears when clicked

  1. #1
    Join Date
    Jan 2009
    Posts
    69

    resolved [RESOLVED] Put text in an input box the disapears when clicked

    Hey all,

    Does anybody know of a way to make the below input box contain text when the page is initially loaded, but that disapears when the box is clicked to allow for user input?

    Thnaks.

    Code:
    <div class="rightColItem staff_search searchItem_staff rc_title">
        <a href="<?php echo get_permalink(88); ?>">Our People: </a>
        <input type="text" value="" id="predictive-term" />
        <ul id="predictive-results" class="staffSearchList"></ul>
    </div>
    Last edited by Gardy; 01-11-2010 at 10:44 AM.

  2. #2
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    Code:
    <input type="text" value="foo" onfocus="if(this.value==this.defaultValue){this.value=''}" onblur="if(this.value==''){this.value=this.defaultValue}" id="predictive-term" />
    At least 98% of internet users' DNA is identical to that of chimpanzees

  3. #3
    Join Date
    Jan 2009
    Posts
    69
    Cheers Fang.

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