PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Validation Error Language

  1. magonicolas
    Member

    Hello, how are you?
    I Read in other post that you can easily change de Valdition error Message.
    That you need to edit it in CSS right?
    Can someone tell me in which File I can edit it please?
    I neeed to change it to spanish.

    Thanks.

    Posted 11 years ago on Monday January 10, 2011 | Permalink
  2. Which validation error message are you referring to? Validation messages for individual fields can be changed by editing those fields in the form builder and selecting the Advanced tab.

    The validation message that appears at the top of the form can be changed by creating a Spanish translation file for the Gravity Forms plugin using PO Edit. It's designed to be localized via translation files.

    If you don't want to translate Gravity Forms you can also change the primary validation message with a simple code snippet you add to your themes functions.php file.

    Here is what the code to change the validation message looks like:

    <?php
    add_filter("gform_validation_message", "change_message", 10, 2);
    function change_message($message, $form){
    return "Your Custom Validation Message Here";
    }
    ?>

    You would place that code in the functions.php file of your theme.

    Posted 11 years ago on Monday January 10, 2011 | Permalink
  3. magonicolas
    Member

    OMG! I added that yo My site and Tottaly Screw it!
    http://www.arriendolocales.cl
    Now don`t have a clue how to fix it, I Upladed the Old Functions.php… and it says more errors :S Wat Can i Do!

    Posted 11 years ago on Monday January 10, 2011 | Permalink
  4. magonicolas
    Member

    I try changing in my Cpnal de functions.php file to the original one… but still no solution. Please Help!

    Posted 11 years ago on Monday January 10, 2011 | Permalink
  5. magonicolas
    Member

    Solve it, Thanks good my hosting is from a friend that backup and restore my files.

    Where in CSS I can change the text?
    Would not like to touch functions.php

    Posted 11 years ago on Monday January 10, 2011 | Permalink
  6. You can't change the text via CSS. It's in the markup and you have to use the filter or a translation file to change it.

    Most likely you just need to remove the <?php ?> from around the snippet when you add it to your functions.php file because those already exist. Just configure/add this part.

    add_filter("gform_validation_message", "change_message", 10, 2);
    function change_message($message, $form){
    return "Your Custom Validation Message Here";
    }
    Posted 11 years ago on Monday January 10, 2011 | Permalink
  7. magonicolas
    Member

    Im Scared of That, Lol. Already Screw my site once this way.

    This is my functions.php
    Can you add it where it should be please?

    Thanks!!

    http://pastie.org/1449504

    Posted 11 years ago on Tuesday January 11, 2011 | Permalink
  8. magonicolas
    Member

    Custom Message:
    No pudimos enviar tu mensaje.
    Los errores están destacados.

    Posted 11 years ago on Tuesday January 11, 2011 | Permalink
  9. You can try this.

    http://pastie.org/1449520

    Posted 11 years ago on Tuesday January 11, 2011 | Permalink
  10. vixvii
    Member

    Thanks for this, it really helped me. Just something I noticed is that when you use the given php code to change the default message, the new message isn't styled in any way :

    ... <div class='gform_heading'>
    <h3 class='gform_title'></h3>
    <span class='gform_description'></span>
    </div>Please make sure all highlighted fields are correct
    <div class='gform_body'> ...

    I added a custom style to the php code in order to make the message display correctly, but I am sure this is a bug and it should actually be displaying inside of the <h3> tag?

    Posted 11 years ago on Monday January 17, 2011 | Permalink