Spent all day trying to think of a nice way of doing this and I'm sure one of you must have come across something similar.
I want an input text box with autosuggest which gets its suggestions from a CFC query.
All good and well and I've conquered that beastie.
In an ideal world the VALUEs of that text box will be an id while the autosuggestions display will be a list of nice text things.
Obviously I know that I can't do that with an input text box... WYSIWYG and the value=display.
But the alternative with typing in one field and then the autosuggestions come up in another field is a bit cumbersome.
I "could" make the "nice text" incorporate the unique id and then manage to pull back the information uniquely later on, but this is also not ideal.
Is there a way of allocating an id to a textbox like this? Or am I smoking something?
And if so, how on earth do I pass back the results from the "select id, description" query in the CFC so that I can use them (and remember that there are multiple values) in the CFM. So far I've only needed (and therefore) mastered the art of passing back 1 column of data from a CFC so I'm still on page 1 of the Hitchhikers Guide so far.
Thanks HUGELY in advance!
Yes, you're absolutely right.
And I've since matured into wanting
1 text field which the user will type a search 'something' into
which magically cfc's and populates 2 other 'just display only' fields and a hidden field to hold the id for the form submission.
And this is where I'm stuck anew because it seems I have to think about cfajaxproxy if I want to populate multiple form fields from one function query. Scaryyyy!
I've seen a couple of examples in which the 'principal' field is a cfselect which triggers the bind onload.
BUT if I don't need a cfselect bound upfront, where must I do the binding in my case. Somewhere after the user types in the search field, but before all the cfajaxproxy meat, I suspect.
Again, any advice sincerely appreciated! I don't want to give up because this is going to be so useful in the future.
I'm getting somewhere with
I managed to replace the main cfselect search field into a text field.
If there is a better way of populating several fields from one query in a cfc, then please yell!
Europe, Middle East and Africa