![]() |
How do you make this kind of search box? [HTML/CSS]
How do you make a search box that says "Search..." and when you click on it, it removes the search text so you can enter in your desired text. When you click off of it it displays "Search..." agian. How is this done in html, css, or js, etc?
|
javascript onfocus event search for that
|
Quote:
|
add this to the input html
onfocus="this.value=''" onblur="this.value='Search...'" |
Quote:
|
Code:
<input type="text" name="search" value="Search..." onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;" /> |
Quote:
I'm using a php script and the default value was: value="{$g_term}" replacing it with value="Search..." ok? I'm trying to figure out what that $var is for and if I can replace it safely. |
Quote:
|
Thanks mattodue.
The search box seems to be working fine without that $g_term variable. |
I wish people were so willing to help when someone asks a business question...
|
Quote:
|
Quote:
|
All times are GMT -7. The time now is 11:44 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123