ADVERTISEMENTS
Before starting this tutorial I would like to tell you I do not know weather this tutorial is legal or not, I do not know are we allowed to customize the Google Custom Search Engine (GCSE) or not, do it at your own risk. Today I am going to tell you, how you can change the watermark image and how to tweak the search button in GCSE. Lets start :
Customizing the textbox
Now, the GCSE code looks like this :

To change the watermark image, copy the javascript source link i.e http://www.google.com/coop/cse/brand?form=cse-search-box&lang=en and open it in browser. When you will carefully look at the javascript code you can see an image link.
(function() { var f = document.getElementById(‘cse-search-box’); if (!f) { f = document.getElementById(’searchbox_demo’); } if (f && f.q) { var q = f.q; var n = navigator; var l = location; if (n.platform == ‘Win32′) { q.style.cssText = ‘border: 1px solid #7e9db9; padding: 2px;’; } var b = function() { if (q.value == ”) { q.style.background = ‘#FFFFFF url(http:\x2F\x2Fwww.google.com\x2Fcoop\x2Fintl\x2Fen\x2Fimages\x2Fgoogle_custom_search_watermark.gif) left no-repeat’; } }; var f = function() { q.style.background = ‘#ffffff’; }; q.onfocus = f; q.onblur = b; if (!/[&?]q=[^&]/.test(l.search)) { b(); } } })();
We have to perform the following steps to change the watermark image :
1. First copy all the javascript code and paste it in Notepad.
2. Now change the watermark.gif image link with your own desired image.
3. Now save the file as google.js and upload it on web.
4. Now, go back to the GCSE code and replace the javascript code with your own edited code i.e

5. And you are done.
For your ease you can download the original javascript code from here and edit the image link.
Customizing the Submit button
Customizing the submit button is very simple, we do not have to edit any javascript rather we will tweak the Style.css file.
Open style.css file and paste this code at the end
#SearchButton {
background:url(Your-Submit-Button-Image-Link-Here) no-repeat;
width:70px; }
Please note : Change the width according to the size of the button image.
Now, in the GCSE code look for
<input type=”submit” name=”sa” value=”Search” />
and change it to
<input type=”submit” name=”sa” value=” ” id=”SearchButton”>
Save you work and you are done!
I know its bit confusing and if you are facing any problem in using this tutorial, drop your comments and I’ll reply to to your queries as soon as possible.
If you like this post, you will love these :
- Submit Your Blog URL To 20+ Top Search Engines In Just A Single Click : Get Traffic From Search Engines : Part3
- How To Make Your Blogger Template Search Engine Optimized
- How To Customize Blockquote In Blogger
- How To Submit Your Blog To Google :Get Traffic From Search Engines : Part1
- How To Submit Your Blog To Yahoo : Get Traffic From Search Engines : Part2
- Improve Your Google Experience : Customize Google [ Firefox Addon ]
- Compare Google, Yahoo, and MSN With One Search
Gaganpreet Singh on July 11, 2009 | Filed Under Blogger Tricks, Google, Google Adsense, Wordpress



Welcome to
{ 1 trackback }
{ 15 comments… read them below or add one }
Thank you very much ! You were really helpful.
Pay a visit to my website in a few days, I will have something ready that I only accomplished because of you !
Thanks, I was looking for a way to customize the google search submit button.
Hey Gagan, Can We add custom Search Button to Adsense Search… I mean will it break TOS
This is actually great information. I’m using Google Custom Search as standard in one of my themes that I’m thinking about releasing for free. Unfortunately the height of Googles search-button is different depending on if you are using IE or FF.
This post was really helpful.I have already incorporated it in my website.Working Fine.
Thanks ,
Regards ,
Sourish
(Admin)
OneTrickADay
thx… Many usefull guides here. thx! well done!
Very helpfull, this is what i looking for…
I was wondering if it was possible to not only change how the button looks but to have it centered under the search box instead of on the side?
I think its no possible. I’ll explore the settings and will let you know sooon.
If its even possible it might not be easy. I’m glad I found this article though as I needed to use a custom button.
Ha! I figured it out. I thought whats the worst that could happen if I simply put some centering tags around it? I figured if it works it has to go somewhere, and it did… Centered right underneath the text box like I wanted.
But I still wasn’t happy as it puts it right under the text box with no space, and I want a space. I tried a break tag and it didn’t work. Then for heck of it I tried paragraph tags and it worked!
So there you have it. For anybody who wants to put the search button centered underneath the text box just use centering tags around the buttons code.
If you want the button centered under the text box with a space between the two use paragraph tags as well with the centering ones.
I haven’t tried this with a modified search button though only the stock one. I can’t see why it wouldn’t work though.
If modifying the search button and watermark are against the Adsense terms of service, and I’m pretty sure I read it somewhere, why would you want to change them and risk having your adsense account shut down and earnings confiscated?
Google offers a paid search service where you can customise these things.
So, be careful!
Hi Gaganpreet I wanna say that Google will severely treat the coders who change the code. I read it some where. Its better to make a note at bottom of post that “Try at your own Rick”.
Hi, I’m having trouble finding the GCSE code on my webpage… if someone could just point me in the right direction I’d be most grateful. Thanks
Hi. Where do I find the GCSE Code? The code google gave me does doesn’t include what you’re saying I should change…