Typo3 formhandler验证电子邮件后缀

时间:2014-01-10 12:12:13

标签: forms validation typo3

我安装了Typo3扩展程序“Formhandler”,一切正常。

但我希望只有在电子邮件后缀等于3个其他人时才能发送表格。

实施例,
我的表格有一个字段“电子邮件: _ __ _ ___ ”,
只有在字段包含

时才能提交表格
<something>@support.example.com
<something>@web.example.com
<something>@news.example.com

我该怎么做?

1 个答案:

答案 0 :(得分:1)

您可以使用preg_Match错误检查来执行此操作。

validators {
  1.class = Validator_Default
  1.config.fieldConf {
    email.errorCheck {
      1 = pregMatch
      1.value = /\b[A-Za-z0-9._%-]+@(support|web|news)+\.(example)+\.(com)\b/
    }
  }
}
相关问题