[BNM] jquery auto complete select dropdown

James Moss email at jamesmoss.co.uk
Wed Jul 1 13:22:28 BST 2009


That should be quite straightforward to to.

   1. Get the options from the standard select using jquery and turn it into
   an array.
   2. Feed the array into the autocomplete plugin at
   http://jquery.bassistance.de/autocomplete/<http://jquery.bassistance.de/autocomplete/demo/>
   3. Replace the <select> in the DOM with the new autocomplete widget.

All this should cccur onDomReady ofc.

James Moss | Developer
Solv.IT | 01273 25 20 24


2009/7/1 Julian Blundell <old at w34u.com>

> Imagine you have
> <select>
>  <option value="1">Option 1</option>
>  <option value="2">Option 2</option>
> etc.
> </select>
>
> Would be nice just to be able to replace with the input box and the nice
> ajaxy download without having to do any further coding, it just works,
> returns the value not the text with the correct name etc. feel that would
> appeal to a lot of developers who are pushed for time and do not need the
> full ajaxy search etc.
>
> Thanks for the code.
>
> Jules
>
> 2009/7/1 Max Williams <toastkid.williams at gmail.com>
>
> > Hi Julian
> > We use the one you linked to (
> > http://jquery.bassistance.de/autocomplete/demo/), without any ajax, just
> > passing it an array that i populate dynamically when the page loads -
> like
> > this (in an erb file)
> >
> >    function initializeAutocompletes() {
> >      var postcodes = <%= @postcodes.inspect %>;
> >      jQuery(".school-postcode-field").autocomplete(postcodes, {
> >        minChars: 3,
> >        max: 2000,
> >        scrollHeight: 500,
> >        matchContains: true
> >      });
> >
> > I don't understand what you mean by "Trouble is they don't seem to think
> of
> > the functionality of just replacing
> > an existing dropdown." though, can you give an example?
> >
> > max
> >
> >
> >
> > 2009/7/1 Julian Blundell <old at w34u.com>
> >
> > > Hi
> > >
> > > I have a html select list that needs to be changed to an auto-complete
> > type
> > > like the windows selection stuff
> > >
> > > Is there a jquery plugin which does this, preferably not by using megga
> > > ajaxy type stuff, the data is already there after all.
> > >
> > > Using this at the moment http://nihilex.com/droplist-filter
> > > but the client wants it to be more like
> > > http://jquery.bassistance.de/autocomplete/demo/
> > >
> > > Trouble is the don't seem to think of the functionality of just
> replacing
> > > and existing dropdown.
> > >
> > > Can anybody help?
> > >
> > > Jules
> > > --
> > >
> > > BNM Subscribe/Unsubscribe:
> > > http://www.brightonnewmedia.org/options/bnmlist
> > >
> > > BNM powered by Wessex Networks:
> > > http://www.wessexnetworks.com
> > >
> > --
> >
> > BNM Subscribe/Unsubscribe:
> > http://www.brightonnewmedia.org/options/bnmlist
> >
> > BNM powered by Wessex Networks:
> > http://www.wessexnetworks.com
> >
> --
>
> BNM Subscribe/Unsubscribe:
> http://www.brightonnewmedia.org/options/bnmlist
>
> BNM powered by Wessex Networks:
> http://www.wessexnetworks.com
>


More information about the BNMlist mailing list. Powered by Wessex Networks