Skip to main content
Known Participant
June 12, 2012
Question

type and select from a query result

  • June 12, 2012
  • 1 reply
  • 2200 views

In CF, I can build a select list using a query:

<select name="produce">

<cfoutput query="name">

<option>#vegatable#

</cfoutput>

I will get a pulldown list such as blue berry, buk-choi, leek, lentil, lettuce, lime, potato, peas, tomato, etc.

I can select one or more from the list.

Is there a way that I can type in the blank input window and bring up the items on the list that match my input?  For example, if I type "le" it will bring up "leek", "lentil", and "lettuce", and it won't display other items on the list that does not being with "le"? 

google search has that capacity.  It will be great if I can do it for a selection list in CF.

Thanks in Advance.

lei

    This topic has been closed for replies.

    1 reply

    Inspiring
    June 12, 2012
    Lei_HuAuthor
    Known Participant
    June 12, 2012

    Thank you I will give it a try and will let you know how it works.

    I have not used <cfform> and <cfinput> for quite a long time and have  used only <form> and <input> with <cfquery>, <cfloop>. I will find out how <cfinput> perform.

    Lei

    Lei_HuAuthor
    Known Participant
    June 12, 2012

    Well I tried a simple autosuggest fuction:

    <cfform>

    <cfinput type="text" 

        autosuggest="Alabama\Alaska\Arkansas\Arizona\Maryland\Minnesota\Missouri"

        name="city" delimiter="\">

        </cfform>

    When I typed "a" in the entry field, the state with A as athe first character did not show up.  Am I missing something?  Do I need to set up something on the server?  I did the above cfinput just to see if it would work, then I could apply a longer list.

    Thanks