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.

change validation message for a specific form

  1. I used in functions.php: add_filter("gform_validation_message_2", "change_message", 10, 2);

    to change validation message for form ID2

    The validation message for this form becomes blank. The others still work.

    How do I change validation message for the form?

    Really, this should be an option in form settings like there is for every field!

    Posted 12 years ago on Thursday August 23, 2012 | Permalink
  2. Can you post the entire code snippet you are using and link to the form please?

    Posted 12 years ago on Thursday August 23, 2012 | Permalink
  3. Here is the code added to functions.php

    add_filter("gform_validation_message_2", "Il manque certaines données. Prière de revoir les champs indiqués en rouge.", 10, 2);

    Here is the page with the form http://www.centrallia.com/fr/volunteer-registration-online-form/

    Thank you.

    Posted 12 years ago on Thursday August 23, 2012 | Permalink
  4. You would want to do this instead:

    <?php
    add_filter("gform_validation_message_2", "change_message", 10, 2);
    function change_message($message, $form){
      return "Il manque certaines données. Prière de revoir les champs indiqués en rouge.";
    }
    ?>
    Posted 12 years ago on Thursday August 23, 2012 | Permalink
  5. It works, but the style is missing?

    Thank you.

    Posted 12 years ago on Thursday August 23, 2012 | Permalink
  6. Whoooooops! Try this instead:

    add_filter("gform_validation_message_2", "change_message", 10, 2);
    function change_message($message, $form){
      return "<div class='validation_error'>Il manque certaines données. Prière de revoir les champs indiqués en rouge.</div>";
    }
    Posted 12 years ago on Thursday August 23, 2012 | Permalink
  7. perfect. Thank you.

    I recommend having the ability to change validation message per form under Form Settings >> Advanced.

    Posted 12 years ago on Thursday August 23, 2012 | Permalink

This topic has been resolved and has been closed to new replies.