Jahia Dev Forum > How can I change...

0 (0 Good)
0 (0 Bad)

How can I change the validation error message?

by  mohitbhunwalia »  2013/07/24 13:52

HI,

I am apply validation on string field using regex in node type defination. When validation become fails , then a error message pop-ups. But I want to change that message with my custom message. Please help me if there any solution... 

  (mohitbhunwalia)

Number of messages  15
Registration date
0 (0 Good)
0 (0 Bad)

Re: How can I change the validation error message?

by  sashok »  2013/08/05 13:17

Hello,

 

I came across this problem recently and to be honest, the solution was a little ugly.

 

Jahia uses a JS validation plugin for form validations - jQuery http://jqueryvalidation.org/

This plugin has the error messages hardcoded inside the java script files. In order to override them, you need to do the following:

http://vfb.matthewmuro.com/faq/how-do-i-translate-the-error-messages-to-my-language/

You can replace the messages with anything you want. You can also manually add the "localization" folder to your modules and then do something like:

<template:addResources type="javascript" resources="localization/messages_${renderContext.mainResource.locale}.js" />

 

Hope this helps.

 

Best Regards,

Alexander KIRILOV
 

  (sashok)

Number of messages  14
Registration date
Contact
Share
Feedback

Get in touch

Whether you are a current user or if you are just evaluating Jahia, we are here to help.

Contact us

Share this page