I wanted to turn an HTML <select> element into an autocomplete. I also wanted to match on more than one attribute. So, I made
jquery.autocomplete_from_select.js.
Thoughts?

Hey! Why don't you make your life easier and subscribe to the full post
or short blurb RSS feed? I'm so confident you'll love my smelly pasta plate
wisdom that I'm offering a no-strings-attached, lifetime money back guarantee!

However, they have a little too much UI chrome for what I was looking for: they'd have looked out of place in the app I was working on that led to this little "project". Rather than try to style them appropriately, it seemed better to just use what I had with jQuery UI, since it already fit in well.

Also, the file I wrote is less than 4 KB without minification. In this app, asset size isn't a huge consideration, but it might be in others.

I dropped the demo script + markup into an existing framework and it didn't working right. (Win8-64, Chrome, jQuery 1.8.3, jQuery UI 1.9.1) It displays a text field. Typing in the value didn't do anything. Reattempting entry would show a drop-down with all options, but typing in "abc" didn't reveal any results and pressing tab cleared out the entry since it didn't match anything.

Will you be posting an simple online demo? I like online demos because I can verify that the script works and does what I think it should do before I download it to try it out. (Some scripts break with newer versions of jQuery.)

Posted by James Moberg
on Feb 26, 2013 at 08:57 AM UTC - 5 hrs

Sure thing. I'll put something in there later today. I did have it clear the entry on purpose if there is no match, though it's easy enough to change that if you're interested.

Your email address is not displayed.
It is used only to respond to you if needed, and
send comments if you subscribe to this comment thread.
It is stored in a cookie if you choose to "Remember my details".