You are here: CTSPedia>System Web>JQueryPlugin>JQueryAutocomplete (14 Jul 2010, AdminUser?)EditAttach
Tags:
create new tag
, view all tags, tagging instructions

JQueryAutocomplete

Homepage: http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/
Author(s): Dylan Verheul, Dan G. Switzer, Anjesh Tuladhar, Joern Zaefferer
Version: 1.1pre

Autocomplete an input field to enable users quickly finding and selecting some value, leveraging searching and filtering. By giving an autocompleted field focus or entering something into it, the plugin starts searching for matching entries and displays a list of values to choose from. By entering more characters, the user can filter down the list to better matches. This can be used to enter previous selected values, eg. for tags, to complete an address, eg. enter a city name and get the zip code, or maybe enter email addresses from an addressbook.

See also JQueryjaxHelper for examples on how to integrate autocompletion into Foswiki.

Usage

Autocompletion is activated for HTML input elements whose autocomplete attribute value does not equal off. It can either be list of candidate values, or an url in which case candidate values are queried from an ajax backend. The current input prefix is provided via the q urlparameter. The backend must return a list of matching values separated by newlines.

Examples

This example queries candidate values from a simple ajax backend using the wiki application in the data section of this topic. Note, that you will need Foswiki:Extensions.FilterPlugin to run the example successfully.

Enter tags:

Tags are suggested as you type. Separate multiple tags using a comma (,).

Backend Implementation

%STARTSECTION{"data"}%%FORMATLIST{
  "
    admin
    backup
    bash
    emulation
    games
    irc
    linux
    mercurial
    patches
    perl
    php
    python
    site
    surfing
    tag
    test
    foswiki
    web
    wiki
    windows
    windsurfing
    wine
  "
  split="\n"
  format=" $1 "
  separator="$n"
  include=".*%URLPARAM{"q"}%.*"
}%%ENDSECTION{"data"}%
Topic revision: r3 - 14 Jul 2010 - 14:43:58 - AdminUser?
 
This site is powered by FoswikiCopyright & by the contributing authors. All material on this site is the property of the contributing authors.
Ideas, requests, problems regarding CTSPedia? Send feedback