This plugin autocompletes email addresses when supplied with an email domain. Instead of the regular jQuery autocomplete's dropdown menu of autocomplete suggestions, this types ahead while keeping the auto-filled text highlighted as to not obstruct the user.
https://demo.hisune.com/jquery.auto-email
$('#your-field').autoEmail(["gmail.com", "foo.org", "foo.com", "foobar.com"], "gmail.com", false);
The method accepts three parameters, domains
and defaultDomain
and multi-enabled
.
domains
is an array of domains to autocomplete with, autocompleting on the first match in the array. Typingjoe@f
in the above example will first autocomplete tojoe@foo.org
. After the user typesjoe@foob
, the field will autocomplete tojoe@foobar.com
.defaultDomain
is a string of your precedence domain to match.multi-enabled
is a boolean flag that enables the user to enter multiple emails in the field, separated by a,
or;