Code:
<cfparam name="searchStr" default=" ">
<cfparam name="newArrayList" default=" ">
<cfset newArrayList=ArrayNew(1)>
<cfif isdefined("form.searchItems") AND form.searchItems neq "">
<cfset searchStr = #trim(form.searchItems)#>
<cfset searchstr = #lcase(searchStr)#>
<cfif searchstr contains " ">
<cfset searchStr = Replace(searchStr," ",",")>
<cfset newArrayList = ListToArray(searchstr)>
<cfif newArrayList[1] neq "">
<cfset item1 = #newArrayList[1]#>
</cfif>
<cfif searchstr contains ",">
<cfset item2 = #newArrayList[2]#>
</cfif>
</cfif>
</cfif>
Try using this code, where i have broken it into two elements and then put them into an array. In case of any further assistance , please do post here.
Bookmarks