需要一个很好的方式让用户选择“To”电子邮件发送 [英] Need a good way for user to select "To" for email sending

查看:207
本文介绍了需要一个很好的方式让用户选择“To”电子邮件发送的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用户可以发送电子邮件的网站。我有一种模仿基本形式:

  To:< Text Input> 
主题:<文本输入>
附件:< Button> <文本输入>
正文< input text>

我有一个数据库表中的电子邮件地址列表,我很容易检索。我试图找到最轻松的方式来支持以下用例:


  1. 允许用户向列表中的所有人发送电子邮件。 >
  2. 允许用户选择组的特定成员

这是一个好办法?一些代码示例存在?



我想到的一种方法是模拟Gmail,只需要开始输入,它将对列表中的电子邮件进行内联搜索。在这种情况下,我想会有一个单独的按钮来选择所有用户。



这只是一个想法。我开放的建议。

解决方案

我在下面的答案中引用的jQuery插件已被一个 jQuery UI组件





$ b $我绝对会推荐自动完成方式。像这样的 jQuery插件将是一个好的开始。您需要修改代码以将逗号作为新的自动完成搜索的触发器。



对于所有成员,yup,所有成员复选框似乎最直截了当如果需要,您还可以在To字段处理中包含关键字触发器,以便像All或Everyone这样的单词将等同于选中复选框。



编辑: jQuery是我的一步,自动完成插件已经支持多个条目

  $(#suggest3)。autocomplete(cities,{
multiple:
mustMatch:true,
autoFill:true
});


I have a website where a user can send out emails from. I have kind of mimics basic form with:

To: <Text Input>
Subject:<Text Input>
Attachments: <Button> <Text Input>
Body <input text>

I have a list of email address in a database table and it's easy for me to retrieve this. I am trying to find the slickest way to support the following use cases:

  1. Allow users to send email to everyone in list.
  2. Allow users to select specific members of group

What would be a good way to do this? Do some code samples exist?

One way I thought of is to mimic Gmail when you can just start typing and it will do an inline search for emails in the list. I guess I would have a separate button to "Select All" users in this case.

That is just one idea. I am open to suggestions.

解决方案

The jQuery plugin I referenced in my answer below has been replaced by a jQuery UI component.


I'd definitely recommend the autocomplete approach. Something like this jQuery plugin would be a good start. You'd need to modify the code to treat commas as a trigger for a new autocomplete search though.

As for the all members, yup, an "All Members" checkbox seems the most straightforward. If you wanted, you could also include keyword triggers in your To field processing so that words like "All" or "Everyone" would be equivalent to selecting the checkbox.

Edit: jQuery is one step ahead of me and the autocomplete plugin already supports multiple entries:

$("#suggest3").autocomplete(cities, {
    multiple: true,
    mustMatch: true,
    autoFill: true
});

这篇关于需要一个很好的方式让用户选择“To”电子邮件发送的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆