Skip to main content
Known Participant
March 15, 2010
Question

Coldfusion search & Google

  • March 15, 2010
  • 1 reply
  • 272 views

I have a web page that I want a person to enter a word and search the database I have through Coldfusion or have google perform a search on my site. How do I get it to search one or the other.. The code I have so far is below

<CFFORM name="formsearch" method="post">

<cfinput type="Text" name="Description" required="No" size="28" maxlength="60" value="search" height="25px;" align="top">

<a href="searchresult.cfm"><img src="images/search_icon.jpg" alt="Search Now" width="24" height="24" border="0" align="top" /></a
>
<input type="radio" name="searchparam" value="mysite" checked="checked"><span class="text">MySite</span>

<input type="radio" name="searchparam" value="web"><span class="text">Web</span>

</CFFORM>

This topic has been closed for replies.

1 reply

ilssac
Inspiring
March 15, 2010

One way I see for this to work is for the form action to change depending on the search option selected, one value sending the request to your page for processing, the other to Google's page for processing.  This is fairly simple to do with JavaScript and is well documented on the internets.

Another way could be to use <cfhttp...> tags on your action page to forward the request to Google for process if desired and outputing the results from the request.