admin管理员组文章数量:1418426
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
3 Answers
Reset to default 2http://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 + "\" <" + row.to + ">";
},
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.
本文标签: javascriptjQuery Email Address InputStack Overflow
版权声明:本文标题:javascript - jQuery Email Address Input - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745279929a2651375.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论