我们的客户使用 TYPO3 6.2.14 并使用formhandler
(2.0.1) 构建了一个公式。现在我们必须添加一个验证码来防止垃圾邮件发送。所以我captcha
按照文档中的建议安装了(1.3.0),并添加了以下几行打字稿(仅限验证部分):
plugin.Tx_Formhandler.settings.predef.contact_test {
# ...
validators{
# default validator
1 {
class = Validator_Default
config {
disableErrorCheckFields = captchafield
fieldConf {
salutation.errorCheck.1 = required
firstname.errorCheck.1 = required
lastname.errorCheck.1 = required
email.errorCheck.1 = required
email.errorCheck.2 = email
subject.errorCheck.1 = required
message.errorCheck.1 = required
}
}
}
# captcha validate
2 {
class = Tx_Formhandler_Validator_Default
config {
disableErrorCheckFields = salutation,firstname,lastname,email,subject,message
fieldConf {
captchafield.errorCheck.1 = captcha
}
}
}
}
# ...
}
必填字段仍然像以前一样工作,并且验证码字段对未填充状态做出反应,如果验证码错误,则中止提交。但是为什么它没有显示“您输入的验证码不匹配”之类的错误?