Reply
Thu 5 Mar, 2009 09:27 am
I am trying to add a Google search to my website, I do not need normal search, what I am looking for is a definition search, you put the word and Google will define it for you. I need that in HTML format. Also if you have any HTML for Google I will be glad to see that. Thank you
Here you go, it uses a JavaScript onsubmit to prepend the define operator to the query.
<form action="http://www.google.com/search" onsubmit="this['q'].value='define: ' + this['q'].value" name="f"><input name="hl" value="en" type="hidden"><input autocomplete="off" maxlength="2048" name="q" size="55" title="Google Search" value=""><input name="btnG" value="Define" type="submit"><input value="f" name="aq" type="hidden"><input value="" name="oq" type="hidden"></form>
@Robert Gentel,
Thank you so much, exactly what I was looking for.
Would you provide me with any other Google's search like, search PDF, Excel.... and search a key word in specific site.........
Thank you,
@ammaryameen,
Just change this part of the code to prepend whatever operator you want:
Code:onsubmit="this['q'].value='define: ' + this['q'].value"
Change 'define: ' to 'site:site.com ' for a specific site, 'filetype:pdf ' for pdf etc.