All most in every web application or website you want visitors to enter their email either for registration, subscription or anything else. Collecting email id is really very important in order to communicate with your visitors, customers or readers. Most of the websites or web applications ask visitors to re-enter email id just to ensure its correctness. You would have seen in many registrations form where you have to enter your email id twice, it is done intentionally to just ensure you have entered a correct email. You can avoid this strategy of asking user to enter his email twice by implementing an intelligent email input self correcting field.
This post will tell you how to implement twitter like self email correction script. If user enters incorrect email (domain name part) then it will immediately tell user the correct one. For example if user enters email@example.com the script will immediately tell him that ‘did you mean firstname.lastname@example.org’? Once users clicks on the suggested email id the suggestion will be removed and email field will grab the suggested email id. This script is really important to make your web page more interactive and user friendly.
So we will use a jquery plugin named “mailcheck.min.js”, developed by Kicksend. This jQuery plugin helps to reduce typos in email addresses. Let’s have a look at how this plugin works and how you can edit it as per your need. ‘mailcheck.min.js’
Now let’s see how we can use this plugin and get it working. Here’s our code:
Kudos to Andrew Brel for nice implementation of mailcheck.min.js.
Mailcheck plugin takes in two call back ‘suggested‘ and ‘empty‘. You can choose only to supply ‘suggested‘ but its recommended to supply both. You can add your own You can edit the ‘mailcheck-min.js’ plugin and add more domain names and top level domains that will be checked when user enters his/her email id.