cf search using verity for my web site. I actually took the code from docs on teh web and tweeked a couple things out on it. Now it is throwing errors and I can't figure out why. What is funny is what is throwing errors was taken strait from the adobe web site docs., so here is my code, I will show you the code I use to index the verity collection, and then the result page.
Indexing code:
- <cfflush>
-
-
<cfquery name="getresults" dataSource="#APPLICATION.dataSource#">
-
SELECT Content.Body, Content.title, Content.page, Content.ContentID
-
FROM Content
-
</cfquery>
-
-
-
<span class="style1"> Indexing data ...</span><br>
-
<cfflush>
-
-
<cfindex action="refresh"
-
collection="pdsSite"
-
key="ContentID"
-
type="custom"
-
title="title"
-
query="getresults"
-
body="title,Body,page">
-
-
Result page:
-
-
<cfsearch name="GetResults"
-
collection="pdsSite"
-
criteria="#FORM.criteria#">
-
<head>
-
</head>
-
<body>
-
<cfform action="result.cfm" method="post">
-
-
<cfinput type="text" name="criteria" value="#FORM.criteria#" message="Please enter your key word to search." validateat="onSubmit" validate="noblanks" required="yes" id="criteria" size="30" class="main_Inputs">
-
-
<cfinput type="submit" value="Search">
-
</cfform>
-
-
<cfoutput>
-
Search Results:#FORM.criteria#
-
</cfoutput>
-
-
<cfif GetResults.RecordCount is 0>
-
No files found for specified search, please try a new search.
-
<cfelse>
-
<cfoutput query="GetResults">
-
<cfset bgcolor=IIf(CurrentRow Mod 2,
-
DE('ffffff'),
-
DE('ffffcf'))>
-
#CurrentRow#
-
<cfset FileName=GetFileFromPath(Key)>
-
<cfset Ext=ListLast(FileName, ".")>
-
<cfif Trim(Title) IS "">
-
<cfset display=GetFileFromPath(Key)>
-
<cfelse>
-
<cfset display=title>
-
</cfif>
-
<a href="#page#" class="subNav">#display#</a> <span class="style8">(#score#)</span> <br>
-
<span class="style8"><small>#body#</small></span>
-
</cfoutput>
-
</cfif>
-
Now here is the first error. (there are a couple, but lets do them one at a time.)
Error message:
Attribute validation error for tag CFINPUT.
The tag requires the attribute(s): NAME.
The error occurred in C:\Websites\result.cfm: line 81
- 79 : <td class="style8">Search:</td>
-
80 : <td><cfinput type="text" name="criteria" value="#FORM.criteria#" message="Please enter your key word to search." validateat="onSubmit" validate="noblanks" required="yes" id="criteria" size="30" class="main_Inputs"></td>
-
81 : <td><cfinput type="submit" value="Search"></td>
-
82 : </tr>
-
83 : </table>
-
I do this kind of stuff all the tie with form fields, and now anything I do to fix it, it throws this error. What am I doing wrong here to place what you used for search critera on a search box in some other place on the site into this search box?
Error 2:
Then my next error is that page is not defined, that is where my link is set up for you to click on the record that gave you results. I can get that error after I fix the search critera error