Skip to main content
Known Participant
August 2, 2013
Question

<cfsearch> for mutiple fields

  • August 2, 2013
  • 1 reply
  • 483 views

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 has been closed for replies.

    1 reply

    p_sim
    Participating Frequently
    August 3, 2013