node package manager

jquery-autosuggestion

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

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