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... 

  • How can I change the validation error message?
    2013/07/24 13:56

    mohitbhunwalia <p> HI,</p> <p> 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...&nbsp;</p>

  • Number of messages  15
    Registration date Jul 24, 2013
    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
     

  • Re: How can I change the validation error message?
    2013/08/05 13:17

    sashok <p> Hello,</p> <p> &nbsp;</p> <p> I came across this problem recently and to be honest, the solution was a little ugly.</p> <p> &nbsp;</p> <p> Jahia uses a JS validation plugin for form validations - jQuery http://jqueryvalidation.org/</p> <p> This plugin has the error messages hardcoded inside the java script files. In order to override them, you need to do the following:</p> <p> http://vfb.matthewmuro.com/faq/how-do-i-translate-the-error-messages-to-my-language/</p> <p> You can replace the messages with anything you want. You can also manually add the &quot;localization&quot; folder to your modules and then do something like:</p> <p> &lt;template:addResources type=<em>&quot;javascript&quot;</em> resources=<em>&quot;localization/messages_</em>${renderContext.mainResource.locale}<em>.js&quot;</em> /&gt;</p> <p> &nbsp;</p> <p> Hope this helps.</p> <p> &nbsp;</p> <p> Best Regards,</p> <p> Alexander KIRILOV<br /> &nbsp;</p>

  • Number of messages  14
    Registration date Aug 5, 2013
    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