Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Put 'search' inside a seach box
Old 10-17-2008, 01:57 PM Put 'search' inside a seach box
Skilled Talker

Posts: 54
Name: Fred
Trades: 0
Hi, I'm using the following code to generate a search box on my blog. Can anyone tell me how I amend this so that the word 'search' will appear in the box. I'm not bothered about the word dissparearing when a user clicks in the box, as I know this involves java or something... but I'd like the word styled in italics and coloured pale grey (#ccc maybe.). It would be extremly helpful if someone could just add to the below text so that I can simply copy/paste.

<form id="searchthis" action="/search" style="DISPLAY: inline" method="get"><input id="search-box" style="BORDER-RIGHT: #cccccc 1px solid; BORDER-TOP: #cccccc 1px solid; FONT-SIZE: 10px; MARGIN: 0px 0px 0px 0px; BORDER-LEFT: #cccccc 1px solid; COLOR: #444444; BORDER-BOTTOM: #cccccc 1px solid" name="q" size="25" type="text/"/></form>

Thanks in advance.
Billy is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-17-2008, 02:42 PM Re: Put 'search' inside a seach box
Brian07002's Avatar
Defies a Status

Posts: 2,162
Name: ...
Location: ...
Trades: 0
Just needed to add the 'value' to the input like this:
Quote:
<form id="searchthis" action="/search" style="DISPLAY: inline" method="get"><input id="search-box" value="Search" style="BORDER-RIGHT: #cccccc 1px solid; BORDER-TOP: #cccccc 1px solid; FONT-SIZE: 10px; MARGIN: 0px 0px 0px 0px; BORDER-LEFT: #cccccc 1px solid; COLOR: #444444; BORDER-BOTTOM: #cccccc 1px solid" name="q" size="25" type="text/"/></form>
Btw, you should use the code or quote tags, it makes it much easier to examine.

Hth
__________________
Made2Own

Please login or register to view this content. Registration is FREE

Last edited by Brian07002; 10-17-2008 at 02:43 PM..
Brian07002 is offline
Reply With Quote
View Public Profile
 
Old 10-17-2008, 04:24 PM Re: Put 'search' inside a seach box
Skilled Talker

Posts: 54
Name: Fred
Trades: 0
Thanks very much, Brian. Very much appreciated. Will remember to use quote tags next time.
Billy is offline
Reply With Quote
View Public Profile
 
Old 10-17-2008, 11:00 PM Re: Put 'search' inside a seach box
Sean@WMS's Avatar
Skilled Talker

Posts: 52
Name: Sean Connors
Location: Eureka, CA USA
Trades: 0
I know you weren't asking for this, Billy, but it is so simple to add the JS to clear the default text . . . . and really, it is SO MUCH more user friendly:

Just add a little line of JS to the onfocus element:

Code:
<form id="searchthis" action="/search" style="DISPLAY: inline" method="get">
<input name="q" size="25" id="search-box" value="Search" style="MARGIN: 0; 
BORDER: #cccccc 1px solid; FONT-SIZE: 10px; COLOR: #444444" 
onfocus="document.searchthis.q.value='';"/>
</form>
BTW, your type="text/" is invalid; need to remove the slash. Or, you could just skip that element as the text type is default.

I also simplified your CSS, as you don't need border-top, border-right, border-bottom & border-left if they are all the same; just use border. Similarly, you could just use margin: 0; if you want not margin all the way around.
__________________
Web Merchant Services

Please login or register to view this content. Registration is FREE
,
Please login or register to view this content. Registration is FREE
Sean@WMS is offline
Reply With Quote
View Public Profile Visit Sean@WMS's homepage!
 
Reply     « Reply to Put 'search' inside a seach box
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.33648 seconds with 12 queries