Skip to content
master
Switch branches/tags
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

About

Cupidon Autocompleter : values must match!

Resources

License

Packages

No packages published