Simple jQuery Email Autocomplete & Suggestion Plugin

File Size: 23.2 KB
Views Total: 11152
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   
Simple jQuery Email Autocomplete & Suggestion Plugin

A user-friendly and mobile-friendly jQuery plugin that suggests and autocompletes the domain suffix from a list of predefined email domains while a user types into the email input field.

Entering the first few letters of your domain will display a suggestion. (e.g "@g" for "@gmail.com"). Click, or press tab-key to autocomplete your email domains.  (or tap on the suggestion for mobile users.)

See also:

Predefined email domains:

  • yahoo.com
  • google.com
  • hotmail.com
  • gmail.com
  • me.com
  • aol.com
  • mac.com
  • live.com
  • comcast.net
  • googlemail.com
  • msn.com
  • hotmail.co.uk
  • yahoo.co.uk
  • facebook.com
  • verizon.net
  • sbcglobal.net
  • att.net
  • gmx.com
  • mail.com
  • outlook.com
  • icloud.com

Basic Usage:

1. Create an email input field with class of 'email' in the page.

<input type="email" class="email" id="email" placeholder="Enter email">

2. Include jQuery javascript library and jQuery Email Autocomplete plugin at the bottom of the page.

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="js/jquery.email-autocomplete.js"></script>

3. Call the plugin and add your own domains in the javascript.

$( document ).ready(function() {
$(".email").emailautocomplete({
domains: ["jqueryscript.net"] // add your own domains
});
});

4. Default plugin options.

suggClass: "eac-sugg",
domains: ["yahoo.com" ,"hotmail.com" ,"gmail.com" ,"me.com" ,"aol.com" ,"mac.com" ,"live.com" ,"comcast.net" ,"googlemail.com" ,"msn.com" ,"hotmail.co.uk" ,"yahoo.co.uk" ,"facebook.com" ,"verizon.net" ,"sbcglobal.net" ,"att.net" ,"gmx.com" ,"outlook.com" ,"icloud.com"]

Changelog:

v0.1.3 (2017-11-21)

  • Fix regression where input was incorrectly matched

v0.1.2 (2017-08-21)

  • Fix domain comparisons to be case-insensitive
  • Fix regression where field did not autocomplete when blur

v0.1.1 (2016-08-16)

  • Add support for bower install

v0.1.0 (2014-08-11)

  • Fixed: Autocompletes when cmd+tabbing

This awesome jQuery plugin is developed by yongzhenlow. For more Advanced Usages, please check the demo page or visit the official website.