How to add a searchbox to a blog.

We know that google has it own searchbox that can be added on the blog. However, you may want to include a similar box. Why? Because the advantage is that unlike Google search box, the search results of this Blogger.com search box appear in the main body of your Blog.

Now lets add the search box.

Go To Layouts->“Add a Gadget” at the place where you want your search box to appear. Select “HTML/JavaScript”.
And paste the below code in there.

<p align="left">
<form id="searchthis" action="YOUR BLOG URL/search" style="display:inline;" method="get">
<strong>Search This Blog<br/></strong>
<input id="b-query" maxlength="255" name="q" size="20" type="text"/>
<input id="b-searchbtn" value="Search" type="submit"/>
</form></p>

Dont forget to change YOUR BLOG URL to the URL or web address of your Blog. Also, That red text called Search This Blog can be changed to something like Search My site or something.

You can also change the “Search” button to say, “Hit” or “Go”, by changing the Value.

Save the code and refresh your blog to see the changes.
Hope you like it.

0 comments:

Post a Comment