Drupal: customizing validation error messages

2019-07-16 12:56发布

问题:

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?

Thanks and greetings c.

回答1:

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.