如何限制电子邮件字段仅允许5个由特定域分开的电子邮件;

发布于 2025-01-24 06:21:32 字数 124 浏览 2 评论 0原文

1.作为UI验证的一部分,我需要在编辑中最多允许5个电子邮件字段。

2.它应该采用所有隔离的电子邮件;

3.所有电子邮件都应在特定域下。

4.在JavaScript或ReactJ中查看。

1.I need to allow maximum of 5 emails in email field on edit as part of UI validation.

2.It should take all emails separated by ;

3.All emails should be under specific domain.

4.Looking in JavaScript or in ReactJS.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

凹づ凸ル 2025-01-31 06:21:32

您可以尝试这样的事情...

function checkValid(inputText) {

  if (
    inputText.split(";").length > 5 ||
    inputText.split(";").length !== inputText.split("@specific.domain").length - 1
  ) {
    // Show error
  } else {
    // Process emails
  }
  
}

You can try something like this...

function checkValid(inputText) {

  if (
    inputText.split(";").length > 5 ||
    inputText.split(";").length !== inputText.split("@specific.domain").length - 1
  ) {
    // Show error
  } else {
    // Process emails
  }
  
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文