Results 1 to 6 of 6

Thread: Search box

  1. #1
    On some websites, there is search box with the 'Search...' text written inside the search box. When u click in the textbox, the 'Search' text disappears and then u can type in ur search words.

    Is this done with Javascript?
    Do u have a code sample which does this??

    thanks

  2. Internet, Programming and Graphics   -   #2
    thedazman's Avatar WaReZeR
    Join Date
    Apr 2005
    Location
    UK
    Age
    39
    Posts
    56
    i dont know much about this, i do little web design. When i do i usually just take examples and edit them.


    On the sites with these search fields, cant you view the source? and find where the code is for the search field and copy it?


    And yeah, i would think it would be javascript.

    Good luck

  3. Internet, Programming and Graphics   -   #3
    Quote Originally Posted by thedazman
    i dont know much about this, i do little web design. When i do i usually just take examples and edit them.


    On the sites with these search fields, cant you view the source? and find where the code is for the search field and copy it?


    And yeah, i would think it would be javascript.

    Good luck
    What a shrude programmer and what a fantastic idea. I wonder why I dont think like this??

  4. Internet, Programming and Graphics   -   #4
    Chewie's Avatar Chew E. Bakke
    Join Date
    Feb 2004
    Posts
    4,008
    There is an 'initial text' box in Dreamweaver's text box properties, which prolly does a similar thing.
    There isn't a bargepole long enough for me to work on [a Sony Viao] - clocker 2008

  5. Internet, Programming and Graphics   -   #5
    david622's Avatar Procrastinator
    Join Date
    Jan 2004
    Location
    USA
    Age
    34
    Posts
    480
    you can do that with html

    Code:
    <html>
    <body>
    <form>
    <input type="text" value="demonstration">
    </form>
    </body>
    </html>
    The tag VALUE="......" is where you input the text that appears within the text box. The text won't go away when you click on the textbox, but you can delete it like any other text you'd type in.

  6. Internet, Programming and Graphics   -   #6
    Code:
    <input name="search" type="text" value="Search" onFocus="if(this.value == 'search'){this.value='';};return true;">
    not tryed it but should work
    Last edited by crysmileyguy!; 04-23-2005 at 01:20 AM.
    cryco pig

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
  •