jquery-autosuggestion

0.0.3 • Public • Published

jQuery plugin for auto suggestion

a simple plugin with which input fields can be extended so that they show a suggestion part

eg if you try to enter an email address it allows you to suggest the domain name

what you type in:

[test           ]

what you can see and get from the input field:

[test@domain.lit]

usage

$('input[type="email"]').autoSuggestion({suffix:"domain.lit"});

if you want to do more stuff with the input you can use a function:

$('input[type="email"]').autoSuggestion({suffix:function (val) {
    if (val === "" || val.indexOf("@") !== -1) {
        return "";
    } else {
        return "@domain.lit";
    }
}});

if you want to have a more robust responsebility you can add the special input event plugin which uses the new oninput event and works for old browsers as well.

depends on

todo

prefix, something better than keyup

/jquery-autosuggestion/

    Package Sidebar

    Install

    npm i jquery-autosuggestion

    Weekly Downloads

    6

    Version

    0.0.3

    License

    none

    Last publish

    Collaborators

    • dodo