• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

autosuggest or problem with valueList and dbase

Participant ,
Jan 04, 2008 Jan 04, 2008

Copy link to clipboard

Copied

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
TOPICS
Advanced techniques

Views

244

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Participant , Jan 04, 2008 Jan 04, 2008
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)>
</cfloop>

<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 work...

Votes

Translate

Translate
Participant ,
Jan 04, 2008 Jan 04, 2008

Copy link to clipboard

Copied

LATEST
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)>
</cfloop>

<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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation