我使用 FormIt 在 ModX 中创建表单:
[[!FormIt?
&hooks=`email`
&emailTpl=`registerEmailTpl`
&emailSubject=`New Registration on Huayang English Website`
&emailTo=`toto@gmail.com`
&successMessage=`Your application has been successfully sent to Huayang.`
&emailFrom=`contact@studychineseinyunnan.com`
&emailFromName=`Huayang School`
&submitVar=`registerForm`
&validate=`given_name:required,
family_name:required,
birthday:required,
gender:required,
address:required,
city:required,
state:required,
country:required,
zip:required,
email:required,
phone:required,
passport_number:required,
place_of_issue:required,
date_of_issue:required,
expiration_date:required,
campus:required,
class_type:required`
]]
问题是我总是收到验证错误,即使我为所有必需的表单输入输入了信息。奇怪的是,表单似乎可以验证:发送成功电子邮件并[[!+fi.successMessage]]
显示。但另一方面,[[+fi.validation_error_message]]
也显示了 并且[[!+fi.validation_error]]
等于1
。[[+errors]]
虽然是空的,但[[!+fi.error]]
应该包含验证错误..
因此,似乎表单正在验证而不是同时验证。
如何调试表单并找到验证错误的来源?