Git Product home page Git Product logo

email-autocomplete's Introduction

jquery.email-autocomplete.js v0.1.1

Build Status

A jQuery plugin that suggests and autocompletes the domain whenever your users type in an email address field.

What does it do?

When your user types in "user@gm", the plugin will suggest for e.g. "[email protected]", based on the first result from a list of predefined email domains.

diagram

Press the tab-key, or simply click on the suggestion to automatically fill in the rest of the domain. (or tap on the suggestion for mobile users.)

You can also use the right arrow key.

See a live demo here.

Installation

#####Bower bower install email-autocomplete --save

#####Manual Download or clone this repo and copy dist/jquery.email-autocomplete.min.js into your javascripts directory.

Usage (jQuery)

Just add jquery.email-autocomplete.min.js into your HTML, before your closing .

<script src="jquery.min.js"></script>
<script src="jquery.email-autocomplete.min.js"></script>

You should also have a email input field.

<input id="email" name="email" type="email" />

Now, attach the plugin to the email input field.

<script>
$("#email").emailautocomplete({
  suggClass: "custom-classname", //default: "eac-sugg". your custom classname (optional)
  domains: ["example.com"] //additional domains (optional)
});
</script>

Styling

Use the following CSS to style the suggestion text color. Remember to update the classname if you've changed it to a custom one.

.eac-sugg {
  color: #ccc;
}

Domains

Email Autocomplete has its own default domains if the domains option isn't provided.

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

Author

License

Copyright (c) 2016

Licensed under the MIT License.

Known Issues:

  • On android stock browser, if "Settings > Accessibility > Scale text up and down" value is not at 100%, text width is unabled to be retrieved correctly.

email-autocomplete's People

Contributors

yongzhenlow avatar pconerly avatar

Watchers

James Cloos avatar Sunnyy avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.