0.0.3 • Published 12 years ago

jquery-autosuggestion v0.0.3

Weekly downloads
12
License
-
Repository
github
Last release
12 years ago

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