Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Coldfusion search & Google

Community Beginner ,
Mar 15, 2010 Mar 15, 2010

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>

TOPICS
Advanced techniques
248
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Mar 15, 2010 Mar 15, 2010
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources