Skip to main content
Known Participant
Aug 2, 2013 4:14 PM UTC
Question

<cfsearch> for mutiple fields

How can search for mutiple fields (criterias)? my code below returns nothing?

Form.cfm:

<form action="search.cfm" method="post">

Name:<input type="text" name="name" />

Desc:<input type="text" name="desc" />

<input type="submit" name="submit" value="Search" />

</form>

search.cfm

<cfset searchTerm = "#form.name#,#form.desc#">

<cfsearch name="searchResults" collection="mycollection" criteria="#searchTerm#">


  <cfdump var="#searchResults#">

thanks

    This topic is closed to new replies. Start a new post to keep the conversation going.

    1 reply

    p_sim
    Participating Frequently
    Aug 3, 2013 3:16 AM UTC