JQuery email login

I need autocomplete / auto-format "To" on my website that works like in GMail.

Does anyone know of such a thing for jQuery?

Plain JavaScript? Or any other alternatives?

+2


source to share


3 answers


There are many, many bits of jquery that do this, you can google for "jQuery autocomplete" and see which one you like best.

The better known here: http://docs.jquery.com/Plugins/AutoComplete



<script>
    var emails = [
        { name: "Kitty Sanchez", to: "kanchez@bluth.com" },
        { name: "Lucille Austero", to: "lucille2@balboatowers.net" },
        { name: "Bob Loblaw", to: "bloblaw@bobloblawlawblog.com" },
        { name: "Sally Sitwell", to: "sally@sitwell.org" }
    ];

    $(document).ready(function(){
        $("#Recipients").autocomplete(emails, {
            multiple: true,
            minChars: 1,
            matchContains: "word",
            autoFill: false,
            formatItem: function(row, i, max) {
                return "\"" + row.name + "\" &lt;" + row.to + "&gt;";
            },
            formatMatch: function(row) {
                return row.name + " " + row.to;
            },
            formatResult: function(row, i, max) {
                return "\"" + row.name + "\" <" + row.to + ">";
            }
        });
    });
</script>

      

+1


source


http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/



Check out this plugin. It looks strong and stable enough to meet your needs. jQuery is the perfect choice for the kind of effect you're looking for. Just keep in mind that depending on where you want to get your data, you need to create some kind of ajax / php backend.

+2


source


These answers are fine, but I think he is looking for something specific via email. Gmail's auto-complete email is very reliable and smart considering who you email most often and other factors.

+1


source







All Articles