PDA

View Full Version : Search box



reminder
04-19-2005, 04:18 PM
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

thedazman
04-19-2005, 04:47 PM
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

reminder
04-19-2005, 06:47 PM
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??

Chewie
04-19-2005, 09:32 PM
There is an 'initial text' box in Dreamweaver's text box properties, which prolly does a similar thing.

david622
04-20-2005, 01:41 AM
you can do that with html



<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.

crysmileyguy!
04-23-2005, 01:20 AM
<input name="search" type="text" value="Search" onFocus="if(this.value == 'search'){this.value='';};return true;">

not tryed it but should work :cry: