Cupidon Autocompleter : values must match!
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
vendor
.gitignore
.travis.yml
CONTRIBUTING.md
Gruntfile.js
LICENSE.md
README.md
cupidon-ac.css
cupidon-ac.js
examples.html
package.json
test.html

README.md

cupidon-ac

Cupidon Autocompleter (a.k.a. cupidon-ac) is an extended jQuery UI Autocomplete widget with a "must match" feature.

Build Status NPM version

Please read this!

More robust & complete solutions now exists, take a look at select2 and chosen.

Demo

→ here

Usage

Cupidon Autocompleter ensure the user selects a value that comes from your source list.

Empty input

<input id="input1" type="text" value="">
// The source is *required*
$('#input1').cupidon({
  source: [{label: "Ruby", value: 1}, {label: "Python", value: 3}]
});
// Source could also be a URL, or any valid jQuery UI Autocompleter source
$('#input1').cupidon({ source: '/cupidon-find-me-a-lover' });

Pre-filled input

<input id="input2" type="text" data-ac-token="Ninja" value="1337">
$('#input1').cupidon({ source: '/cupidon-find-me-a-lover' });

See the demos for more usage information.

Features

Basically mimicks the behaviour of a select tag with an arbitrary source (URL or fixed JSON dataset):

  • Does not accept values that are not in the source,
  • Shows the selected value at load without any additionnal HTTP request,
  • Supports key-value pairs (just like select tags).
  • Tested (here)

Options

  • changeText: specify the text to use for the edit link

Contributing

Use GitHub issues for questions, issues and feature requests.

See CONTRIBUTING.md for more details on contributing and running test.

Credits

hooktstudios

cupidon-ac is maintained and funded by hooktstudios