1 Reply Latest reply on Jan 4, 2008 11:33 AM by wam4

    autosuggest or problem with valueList and dbase

    wam4 Level 1
      I have an autosuggest field on a form that displays a list of names. The form works fairly well when using valueList(query.column) but my real problem is that within the database the column contains "lastname , firstname MI" where the last name is followed by a comma. ValueList strips everything after the comma so my list only displays and populates last names. I need the whole field since there are over 4000 names in the database and "Smith" occurs more than once. The user won't know which "Smith" he's selecting. In the cfc I've tried removing valueList but this only populates one name in the drop down box. It defeats the purpose of having an autosuggest field if only one name shows up. Any suggestions? thanks, Wendy
        • 1. Re: autosuggest or problem with valueList and dbase
          wam4 Level 1
          Problem solved. I went back to Ben Forta's sample and now it works.

          Here's what I modified in the above code:
          Instead of using the cfreturn listToArray(valueList... I changed back to
          <cfloop query="getcontacts">
          <cfset ArrayAppend(result, NAME)>

          <cfreturn result>

          In the query I the changed the 2nd to last line to "And NAME LIKE upper('#ARGUMENTS.search#%') : as well as changing the cfargument name from suggestvalue to search

          On my form I changed the size to "50"
          Now it works fine