SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2011
    Posts
    59
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Search Box Question

    Hi Guys,

    I wonder if anyone can help with this. I've just added a search bar to my site: http://simonpaulcreative.com/
    I've managed to get the word "Search" to shot up in the text field, but unlike other search boxes that I have seen it doesn't disappear when it's clicked on. I'd like it to behave just like the "Search Site" text in the search field on the Sitepoint homepage.

    Any ideas?
    simon

    HTML Code:
          <div id="searchwrapper">
              <form style="margin:0px; margin-top:4px;" action="http://search.freefind.com/find.html" method="get" accept-charset=
              "utf-8" target="_self">
              <input type="text" class="searchbox" name="query" value="Search" />
              <button type="submit" value="search" class="searchButton"><img src="images/blankImage.png"></img></button>
              <input type="hidden" name="si" value="82539342">
              <input type="hidden" name="pid" value="r">
              <input type="hidden" name="n" value="0">
              <input type="hidden" name="_charset_" value="">
              <input type="hidden" name="bcd" value="&#247;">
          </form>
    	</div>

    Code:
    #searchwrapper {
    	float: right;
    	width:161px; 
    	height:30px;
    	background-image: url(../images/searchBg.png);
    	background-repeat:no-repeat; 
    	padding:0px;
    	margin: 7px 16px 0 0;
    	position:relative;
    } 
    #searchwrapper form { 
    	display:inline; 
    } 
    .searchbox {
    	border:0px; 
    	background-color:transparent; 
    	position:absolute; 
    	top:4px;
    	left:11px;
    	width:126px;
    	height:21px;
    	border: none;
    	line-height: 24px;
    	color: #757580;
    }
    .searchButton {
    	border:0px; 
    	background-color:transparent; 
    	position:absolute; 
    	top:3px;
    	left:138px;
    	width:20px;
    	height:24px;
    	cursor: pointer; cursor: hand;
    }

  2. #2
    SitePoint Enthusiast
    Join Date
    Nov 2011
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Post

    Check this:
    HTML Code:
    <input id="s" style="width: 30%; height: 20px;" onfocus="if (this.value == '') {this.value = 'Something to search';}" onblur="if (this.value == '') {this.value = '';}" type="text" name="s" size="23" /> <input id="searchsubmit" type="button" name="en" value="Search" /> <input title="Clear results" type="reset" value=" X " alt="Clear results" />


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
  •