How to always add some extra hidden text to what is submitted through a Form?

I am working with a Search Box that I want to only search a specific site. To get it to do that I need to add the following to the front of each search query site:www,mysite,com
(I used commas just to keep it from showing here as an UL)

This is just like what people would do from one of the major search engines IF they new that adding site:www,mysite,com to their query would limit the results to only that site’s results :rolleyes:

Here is a sample of the current code:

<form class=“navbar-search” method=“get” action=“http://www.searchengine.com/search” >
<input type=“text” name=“query”>
</form>

Basically I just want to automatically always add or apend this text site:www,mysite,com to “query” when it is submitted. Is this possible? How???

Is this a Google search? If so, you can get the form code from Google itself.

<form method="get" action="http://www.google.com/search">
  <label for="q">Search this Site</label> 
  <input type="text" name="q" id="q" value=""> 
  <input type="submit" value="Search">
  <input type="hidden" name="sitesearch" value="mysite.com">
</form>

Hi Ralph, thanks for the quick response!

Your code works great - but unfortunately I think it is a backdoor way of getting “Google Site Search” which is supposed to cost $100 a year. See http://www.google.com/enterprise/search/products_gss.html

We can’t afford to piss off the Google monster :wink:

I’m looking for something that can be used with any smaller alternative searchengine that allows having the search result narrowed to a particular site…

That’s if you want the customized version, but there’s nothing wrong with using the code I posted. It’s just a bit of a plain experience, but there’s not problem using it. It’s provided by Google.