Graham301 0 Newbie Poster

I am using Ben Forta AutoSuggest example. I have the autosuggest working but I need to get another record out of the database to send the user to the right url. I don't know how to do this, can someone help me out?

CFC: Code

<cfcomponent output="false">

<cfset THIS.dsn="myprod">

    <!--- Lookup used for auto suggest --->
    <cffunction name="lookupArt" access="remote" returntype="array">
    <cfargument name="search" type="any" required="false" default="">

<!--- Define variables --->
<cfset var data="">
<cfset var result=ArrayNew(1)>

<!--- Do search --->
<cfquery datasource="#THIS.dsn#" name="data">
SELECT PartNumber, Link
FROM Products
WHERE UCase(PartNumber) LIKE Ucase('#ARGUMENTS.search#%')
ORDER BY PartNumber
</cfquery>

<!--- Build result array --->
<cfloop query="data">
<cfset ArrayAppend(result, PartNumber)>
<cfset ArrayAppend(result, Link)>
</cfloop>

        <!--- And return it --->
<cfreturn result>
    </cffunction>

</cfcomponent>

I need the link to be sent every time this cfc is called from this page below.

<cfform><cfinput type="text"
        name="PartNumber" style="border:0; width:200px; height=40px; font-size:2em;"
        autosuggest="cfc:art.lookupArt({cfautosuggestvalue})">
        <cfinput type="submit" name="submit" value = "show me the result"> 

</cfform>

How would I send the link to this form? Would I use binding?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.