Skip to main content
Known Participant
Jun 12, 2012 3:02 PM UTC
Question

type and select from a query result

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 is closed to new replies. Start a new post to keep the conversation going.

    10 replies

    Inspiring
    Jun 12, 2012 3:06 PM UTC
    Lei_HuAuthor
    Known Participant
    Jun 12, 2012 3:23 PM UTC

    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

    Translate
    Lei_HuAuthor
    Known Participant
    Jun 12, 2012 9:52 PM UTC

    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

    Translate