cupidon-ac

0.1.1 • Public • Published

cupidon-ac

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

Build Status

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

Readme

Keywords

none

Package Sidebar

Install

npm i cupidon-ac

Weekly Downloads

3

Version

0.1.1

License

none

Last publish

Collaborators

  • j15e