Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CFSearch Criteria

Status
Not open for further replies.

ecintern

Programmer
Joined
Feb 23, 2001
Messages
7
Location
CA
I am trying to use a string variable NoCommas as the search criteria for a CFSearch. Everytime I try it I get an invalid criteria error. I am using it in the following way

<cfif #Form.AllFields# is not &quot;&quot;>
<cfset NoPeriods = &quot;<cfoutput>#Replace(Form.AllFields,&quot;.&quot;,&quot;*&quot;, &quot;all&quot;)#</cfoutput>&quot;>
<cfoutput>#NoPeriods#</cfoutput>
<cfset NoCommas = &quot;<cfoutput>#Replace(NoPeriods,&quot;,&quot;,&quot;\,&quot;, &quot;all&quot;)#</cfoutput>&quot;>
<cfoutput>#NoCommas#</cfoutput>

<CFSEARCH NAME= &quot;GetAllFields&quot;
COLLECTION= &quot;HolmpsonSearchAll&quot;
TYPE= &quot;explicit&quot;
CRITERIA= &quot;#NoCommas#&quot;>

I don't understand why this should cause an error. Anyone know?

Thanks ahead of time

ECintern
 
Hey ECintern,

It's been a while since I've used <cfsearch> but my initial suspicion is that you need to remove the &quot;<cfoutput>&quot; strings from your <cfset> statements. This will become part of your search criteria and may be causing the problem. If you are wanting the search to specifically look for &quot;<cfoutput> strings, I believe you will have to escape the &quot;<&quot; and &quot;>&quot; characters as these are special characters used by <cfsearch>.

If this doesn't help, let me know and I'll look up some info on the <cfsearch> tag and try to narrow it down.

GJ
 
Status
Not open for further replies.

Similar threads

  • Locked
  • Question Question
Replies
4
Views
232
  • Locked
  • Question Question
Replies
2
Views
212
Replies
0
Views
141

Part and Inventory Search

Sponsor

Back
Top