Dynamically parameters in Ajax.Autocompleter

Two days ago I had a problem with Ajax.Autocompleter (from script.aculo.us library). I needed to use dynamically parameters sending in request to the server. Basically they are created only statically when class is set up. To change this behaviour use this solution:

new Ajax.Autocompleter(
    'search',
    'autocomplete_choices',
    'index.php?controller=search&action=autocomplete, {
        paramName: 'name',
        callback: function(element, entry) {
            return entry+"&"+Form.Element.serialize('type');
        }
    }
);
Share and Enjoy:
  • Google Bookmarks
  • Twitter
  • BLIP - Bardzo Lubię Informować Przyjaciół
  • pinger.pl - Nie taki zwykły blog.
  • Facebook
  • del.icio.us
  • Digg
  • Wrzuć to na Flakera - powiadom swoich Znajomych
  • grono.net - internetowa społeczność przyjaciół
  • Netvibes
  • LinkedIn
  • Technorati
  • Dodaj niusa « OSnews.pl

0 comments ↓

There are no comments yet...Kick things off by filling out the form below.

Leave a Comment