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.

How can I change the message displayed when required fields empty

  1. natash
    Member

    Hi,

    On my forms, I have required fields. When there are empty, the following message is displayed :

    There was a problem with your submission.
    Errors have been highlighted below

    How can I change this message ?

    Thank you

    Posted 13 years ago on Sunday September 12, 2010 | Permalink
  2. You can change the message for individual form fields by editing the field, going to the Advanced tab and customizing the validation message.

    However the message you referenced above is the form wide validation message. Currently this can only be customized by a filter using PHP. Here is an example of the filter you would use to do this:

    <?php
    add_filter("gform_validation_message", "change_message", 10, 2);
    function change_message($message, $form){
    return "Failed Validation - " . $form["title"];
    }
    ?>
    Posted 13 years ago on Sunday September 12, 2010 | Permalink
  3. STB
    Member

    Was looking for the same,

    @Carl Hankcock
    Thanks, but .. this code goes where?

    Posted 13 years ago on Sunday September 12, 2010 | Permalink
  4. you add the code snippet to your theme's functions.php file.

    Posted 13 years ago on Sunday September 12, 2010 | Permalink
  5. STB
    Member

    Thanks Kevin.

    I found you can also just change the message in form_display.php.

    Would there be any advantage of adding the filter to functions.php, over directly editing the message in form_display.php?

    Posted 13 years ago on Monday September 13, 2010 | Permalink
  6. You never want to edit the core plugin files if you ever plan on updating to the latest version of Gravity Forms because any changes you make will be overwritten by the update.

    The API hooks are there to allow you to change the functionality of Gravity Forms WITHOUT having to edit the plugin files themselves. This makes updates seamless so you can upgrade without overwriting your changes.

    We always recommend users make changes using the API hooks and placing the code in the functions.php file for their theme.

    Posted 13 years ago on Monday September 13, 2010 | Permalink
  7. Trisha
    Member

    Seems like this is a reasonable request - to change the general form validation message - why not consider making this an option in a future upgrade? I see where I can set the Form's Description and Confirmation Message, so why not allow me to set my own Validation (error) Message too?

    Posted 12 years ago on Friday September 2, 2011 | Permalink