https://github.com/thinkphp/mailcheck.js
A MooTools plugin that suggests a right domain when your users misspell it in an email address using Levenshtein Distance.
https://github.com/thinkphp/mailcheck.js
Last synced: 7 months ago
JSON representation
A MooTools plugin that suggests a right domain when your users misspell it in an email address using Levenshtein Distance.
- Host: GitHub
- URL: https://github.com/thinkphp/mailcheck.js
- Owner: thinkphp
- Created: 2012-03-21T20:49:34.000Z (almost 14 years ago)
- Default Branch: master
- Last Pushed: 2012-03-22T10:59:10.000Z (almost 14 years ago)
- Last Synced: 2025-06-03T18:54:22.236Z (8 months ago)
- Language: JavaScript
- Homepage: http://thinkphp.ro/apps/js-hacks/mailcheck.js/Demos/mailcheck.html
- Size: 97.7 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
mailcheck.js
============
A MooTools plugin that suggests a right domain when your users misspell it in an email address using Levenshtein Distance.

How to use
----------
Include MooTools, Mailcheck.js and String.levenshtein.js into the page:
When your user types in "adrian@yahuu.com", Mailcheck will suggest "adrian@yahoo.com".
#HTML
Email
When DOM is ready:
#JS
var domains = ['hotmail.com', 'gmail.com', 'yahoo.com','aol.com','excite.com','thinkphp.ro']
$('email').addEvent('keyup',function(){
new Mailcheck($('email'),{domains: domains, onSuggested: function(suggestions){
$("suggestions").set('html', 'Did you mean ' + suggestions.join(", ") + " ?");
},onEmpty: function(){
//do stuff
}
})
})
References:
- http://thinkphp.ro/apps/js-hacks/String.levenshtein/String.levenshtein.html
- https://github.com/Kicksend/mailcheck
- http://en.wikipedia.org/wiki/Levenshtein_distance