魔术形式自定义消息不起作用

时间:2019-02-28 10:20:00

标签: octobercms octobercms-plugins

我收到这些标准错误消息,而不是我的自定义消息

  

评论字段为必填项。

     

必填字段。电子邮件

     

必须是有效的电子邮件地址。


即使在组件中,我也有以下设置:

[genericForm contactForm]
group = "Contact"
rules[comments] = "required"
rules[name] = "required"
rules[email] = "required|email"
rules[phone] = "numeric"
rules_messages[name.required] = "Gelieve uw naam in te vullen"
rules_messages[comments.required] = "U bent uw vraag vergeten te stellen"
rules_messages[email.required] = "Gelieve uw email toe te voegen"
rules_messages[email.email] = "Uw e-mail adres klopt niet"
rules_messages[phone.numeric] = "Uw telefoonnummer klopt niet"
messages_success = "Uw formulier was succesvol verzonden. We nemen zo spoedig mogelijk contact met u op!"
messages_errors = "Er zijn problemen met het versturen van het formulier"
mail_enabled = 1
mail_recipients[] = "miguel@kixx-concept.be"
reset_form = 1
inline_errors = "display"
sanitize_data = "disabled"
anonymize_ip = "disabled"
recaptcha_theme = "light"
recaptcha_type = "image"
recaptcha_size = "normal"

虽然Flash消息均正确显示,但这只是自定义消息。 在文档中,关于如何使用它很清楚,那么我在这里想念的是什么?

其他问题:我已经使其能够处理“内联错误:显示错误”。但是我还没有找到如何在选择内联错误时使该Flash错误消息出现在无效提交的顶部。

1 个答案:

答案 0 :(得分:0)

“这两个Flash消息都在显示...”是什么意思?

如果您的页面上没有出现默认的Flash消息,请确保已加载jquery和框架附加功能。

这是我设置组件的方式,它工作正常。这是在查看主题文件夹中的页面文件时。

[genericForm]
rules[name] = "required"
rules[email] = "required|email"
rules_messages[name.required] = "We need your Name please"
rules_messages[email.email] = "Your Email needs have a correct syntax"
rules_messages[email.required] = "We need your Email please"
messages_success = "Your form was successfully submitted"
messages_errors = "There were errors with your submission"
inline_errors = "disabled"
sanitize_data = "disabled"
anonymize_ip = "disabled"
recaptcha_theme = "light"
recaptcha_type = "image"
recaptcha_size = "normal"

enter image description here

enter image description here

enter image description here