Wednesday, December 14, 2011

Pin It

Widgets

Multiple Search Box For Your Blog




If you want to keep a multiple search box in your blog here is the code. It has the options to search in different search engines like Google, Yahoo, Dogpile, etc.. Lets see the steps how to set it on blog.

HTML code:
Keep this code anywhere in your blog either going into Edit Html in template section of your blog or by simply by going to Layout-Add a Gadget-Html/Javascript.



<form name="searchform" onsubmit="return dosearch();">
Search:
<select name="sengines">
<option value="http://www.google.com/search?q=" selected />Google
<option value="http://www.altavista.com/web/results?q=" />Alta Vista
<option value="http://www.dogpile.com/info.dogpl/search/web/" />Dogpile
<option value="http://search.yahoo.com/search?p=" />Yahoo!
</select>
For:
<input type="text" name="searchterms" />
<input type="submit" name="SearchSubmit" value="Search" />
</form>


JavaScript:
Keep this Javascript in anywhere in head section of your blog code or goto Layout-Add a Gadget-Html/Javascript.


<script type="text/javascript">
function dosearch() {
var sf=document.searchform;
var submitto = sf.sengines.options[sf.sengines.selectedIndex].value + escape(sf.searchterms.value);
window.location.href = submitto;
return false;
}
</script>





0 comments

Post a Comment