Click here to Skip to main content
11,921,889 members (59,311 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


2 bookmarked

Search your web page with Google's Engine

, 17 Jan 2011 CPOL
Rate this:
Please Sign up or sign in to vote.
Search your web page with Google's Engine
Hi everyone,
This time I want to show how you can add a search text box in your web page using Google's search engine, so you can get full search functionality without writing any code, no matter what programming language you use.


<form action="" method="get" name="searchform" target="_blank">
<table border="0" cellpadding="0" cellspacing="0">
    <input name="sitesearch" type="hidden" value="" />
    <input alt="search" name="as_q" size="20" type="text" value="Search this web" />
    <input title="Search" type="submit" value="Search" />


This is just an HTML form which contains a hidden field with the URL where we want Google to search, an input (TextBox) where user can input what he/she wants to search, and a submit button.

The ACTION of the form is the Google's Search Engine URL and will be opened in a new tab in the browser when user clicks the submit button.
As we are using the GET method, the resulting URL would be something like this:

Working Example

If you want to check how it works, just check this example.
Hope you like it. As ever, please feel free to leave any comment, suggestion or question.

Thanks for reading!


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Team Leader
Spain Spain
No Biography provided

You may also be interested in...

Comments and Discussions

GeneralReason for my vote of 5 Cool one. Pin
thatraja30-Mar-11 6:57
mvpthatraja30-Mar-11 6:57 
GeneralRe: Hey, thanks Thatraja! Pin
nereo.lopez31-Mar-11 21:43
membernereo.lopez31-Mar-11 21:43 
GeneralReason for my vote of 4 because it helped me. was a new thin... Pin
ahsan sarfraz23-Jan-11 22:00
memberahsan sarfraz23-Jan-11 22:00 
GeneralRe: Well, thanks for voting! Hope you can take advantage of it :... Pin
nereo.lopez23-Jan-11 22:35
membernereo.lopez23-Jan-11 22:35 
Well, thanks for voting! Hope you can take advantage of it Smile | :)

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.151120.1 | Last Updated 17 Jan 2011
Article Copyright 2011 by nereo.lopez
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid