Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jquery: Filter dropdown list as you type

I have used a prototype plugin which filters the contents of a dropdown as you type. So for example if you typed 'cat' into the text box, only items containing the substring 'cat' would be left as options in the drop down.

Does anyone know of a jquery plugin which can do this?

like image 387
Robin Barnes Avatar asked Apr 01 '09 18:04

Robin Barnes


2 Answers

I was just looking for something similar, and the best one for what I need seems to be the JQuery UI MultiSelect. It turns Multi-select boxes into a pretty slick dual-list view, with live filtering on the master list.

EDIT: New Development!

"Chosen is a JavaScript plugin that makes long, unwieldy select boxes much more user-friendly. It is currently available in both jQuery and Prototype flavors."

I'm totally using Chosen on all select-using projects in the foreseeable future.

like image 200
Ed Brannin Avatar answered Sep 20 '22 12:09

Ed Brannin


Select2 is a fairly recent fork of Chosen and has tons more features (e.g. AJAX + custom HTML for individual items).

like image 30
ifarted Avatar answered Sep 17 '22 12:09

ifarted