javascript - jQuery Email Address Input - Stack Overflow

I'd like an autopleteautoformat "To" field on my web site that works like the one in GM

I'd like an autoplete/autoformat "To" field on my web site that works like the one in GMail.

Does anyone know of such a thing for jQuery?

Plain JavaScript? Or any other alternatives?

I'd like an autoplete/autoformat "To" field on my web site that works like the one in GMail.

Does anyone know of such a thing for jQuery?

Plain JavaScript? Or any other alternatives?

Share Improve this question edited Sep 22, 2015 at 0:48 Undo 25.7k38 gold badges112 silver badges131 bronze badges asked Oct 7, 2009 at 19:44 Zack PetersonZack Peterson 57.4k80 gold badges210 silver badges281 bronze badges 1
  • I had to remove the image from your post because ImageShack has deleted it and replaced it with advertising. See meta.stackexchange./q/263771/215468 for more information. If possible, it would be great for you to re-upload them. Thanks! – Undo Commented Sep 22, 2015 at 0:48
Add a ment  | 

3 Answers 3

Reset to default 2

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

Check out this plugin. It appears to be quite robust and stable and may meet your needs. jQuery is a perfect choice for the kind of effect your seeking. Just keep in mind that, depending on where you want to get your data from, you'll need to create some sort of ajax/php backend.

There are lots and lots of jquery bits that do this, you can google for "jquery autoplete" and see which you like best.

Here's one that is more famous: http://docs.jquery./Plugins/AutoComplete

<script>
    var emails = [
        { name: "Kitty Sanchez", to: "[email protected]" },
        { name: "Lucille Austero", to: "[email protected]" },
        { name: "Bob Loblaw", to: "[email protected]" },
        { name: "Sally Sitwell", to: "[email protected]" }
    ];

    $(document).ready(function(){
        $("#Recipients").autoplete(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>

These answers are fine but I think he's looking for something email specific. Gmail's email auto plete is very robust and smart taking into account like who you email most often and other factors.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745279929a4620230.html

相关推荐

  • javascript - jQuery Email Address Input - Stack Overflow

    I'd like an autopleteautoformat "To" field on my web site that works like the one in GM

    2小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信