Drupal:自定义验证错误消息 [英] Drupal: customizing validation error messages

查看:119
本文介绍了Drupal:自定义验证错误消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当用户提交自定义CCK表单并且标记为REQUIRED的字段为空时,我得到xyz字段是必需的。
如何自定义此消息而不修改核心模块?

when the user submits a custom CCK form and a field marked as REQUIRED is empty, i get a "xyz field is required.". How can i customize this message without modifying core modules?

感谢和问候
c。

Thanks and greetings c.

推荐答案

根据错误信息以及需要如何更改,您可能可以使用 String覆盖模块来替换用于生成消息的字符串。

Depending on the error message and how you need to change it, you may be able to use the String Overrides module to replace the string used to generate the message.

另一个选项是创建一个自定义模块,针对特定表单验证功能字段,用您选择的消息替换任何错误消息。

Another option is to create a custom module that overrides the validation function for a particular form or field, replacing any error messages with the messages of your choosing.

这篇关于Drupal:自定义验证错误消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆