cupidon-ac
v0.1.1
Published
> Cupidon Autocompleter (a.k.a. cupidon-ac) is an extended [jQuery UI Autocomplete](http://jqueryui.com/autocomplete/) widget with a "must match" feature.
Downloads
2
Readme
cupidon-ac
Cupidon Autocompleter (a.k.a. cupidon-ac) is an extended jQuery UI Autocomplete widget with a "must match" feature.
Demo
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 theedit
link
Contributing
Use GitHub issues for questions, issues and feature requests.
See CONTRIBUTING.md for more details on contributing and running test.
Credits
cupidon-ac is maintained and funded by hooktstudios