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="http://www.google.com/search" method="get" name="searchform" target="_blank">
<table border="0" cellpadding="0" cellspacing="0">
<input name="sitesearch" type="hidden" value="http://nereolopez.blogspot.com" />
<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 (
) where user can input what he/she wants to search, and a submit button.
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
method, the resulting URL would be something like this:
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!