• Latest Code...

    Validate email in JavaScript?


    This is one of those useful things that people will be Googling for validate email address on Javascript, this tutorial mostly used when you are developing app on Cross platform, like sencha, phonegap.

    function validateEmail(email) {
        var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
        return re.test(email);

    }

    Here, Using regular expressions is probably the best way. Here's an example (live demo):


    Happy Coding!!!

    3 comments:

    1. I am grateful for this blog to distribute knowledge about this significant topic. Here I found different segments and now I am going to use these new instructions with new enthusiasm. validate email list

      ReplyDelete
    2. I read this article, it is really informative one. Your way of writing and making things clear is very impressive. Thanking you for such an informative article. best email finder

      ReplyDelete
    3. I got information from your article which you have shared here. I will be sharing with my friends who will need this info. Thanks for it, Keep posting. Email Marketing Services For Small Business

      ReplyDelete

    Circle

    Most recent Elastic Search tutorials for beginner, intermediate and advance level developer, Yubraj Pokharel, in CodingWorkspace